Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sde_lib: fixed make bug #48

Merged
merged 1 commit into from
Sep 18, 2023
Merged

sde_lib: fixed make bug #48

merged 1 commit into from
Sep 18, 2023

Conversation

calebyhan
Copy link
Contributor

@calebyhan calebyhan commented Jul 12, 2023

Pull Request Description

While testing src/components/sde/tests/Counting_Set, I encountered a bug running make.

calebhan ~/papi-calebyhan/> cat src/components/sde/tests/Counting_Set/Makefile
exe = Simple_CountingSet_Driver++

${exe}: Simple_CountingSet_Driver++.o CountingSet_Lib++.o
        g++ -Wall \
        -L         ${HOME}/papi-calebyhan/src/install/lib \
        -Wl,-rpath,${HOME}/papi-calebyhan/src/install/lib \
        -L         ${HOME}/papi-calebyhan/src/testlib \
        -o $@ $^ -lpapi -lsde -ltestlib

%.o: %.cpp
        g++ -Wall \
        -I ${HOME}/papi-calebyhan/src/install/include \
        -I ${HOME}/papi-calebyhan/src/testlib \
        -c -o $@ $<

clean:
        -rm -f *.o ${exe}
        
calebhan ~/papi-calebyhan/src/components/sde/tests/Counting_Set/> make
g++ -Wall \
-L         /home/calebhan/papi-calebyhan/src/install/lib \
-Wl,-rpath,/home/calebhan/papi-calebyhan/src/install/lib \
-L         /home/calebhan/papi-calebyhan/src/testlib \
-o Simple_CountingSet_Driver++ Simple_CountingSet_Driver++.o CountingSet_Lib++.o -lpapi -lsde -ltestlib
/usr/bin/ld: CountingSet_Lib++.o: in function `papi_sde::operator++(papi_sde::PapiSde::CreatedCounter&)':
CountingSet_Lib++.cpp:(.text+0x0): multiple definition of `papi_sde::operator++(papi_sde::PapiSde::CreatedCounter&)'; Simple_CountingSet_Driver++.o:Simple_CountingSet_Driver++.cpp:(.text+0x0): first defined here
/usr/bin/ld: CountingSet_Lib++.o: in function `papi_sde::operator--(papi_sde::PapiSde::CreatedCounter&)':
CountingSet_Lib++.cpp:(.text+0x2d): multiple definition of `papi_sde::operator--(papi_sde::PapiSde::CreatedCounter&)'; Simple_CountingSet_Driver++.o:Simple_CountingSet_Driver++.cpp:(.text+0x2d): first defined here

Upon changing src/install/include/sde_lib.hpp (and the corresponding src/sde_lib/sde_lib.hpp), the make runs as expected:

calebhan ~/papi-calebyhan/src/components/sde/tests/Counting_Set/> make clean
rm -f *.o Simple_CountingSet_Driver++
calebhan ~/papi-calebyhan/src/components/sde/tests/Counting_Set/> make
g++ -Wall \
-I /home/calebhan/papi-calebyhan/src/install/include \
-I /home/calebhan/papi-calebyhan/src/testlib \
-c -o Simple_CountingSet_Driver++.o Simple_CountingSet_Driver++.cpp
g++ -Wall \
-I /home/calebhan/papi-calebyhan/src/install/include \
-I /home/calebhan/papi-calebyhan/src/testlib \
-c -o CountingSet_Lib++.o CountingSet_Lib++.cpp
g++ -Wall \
-L         /home/calebhan/papi-calebyhan/src/install/lib \
-Wl,-rpath,/home/calebhan/papi-calebyhan/src/install/lib \
-L         /home/calebhan/papi-calebyhan/src/testlib \
-o Simple_CountingSet_Driver++ Simple_CountingSet_Driver++.o CountingSet_Lib++.o -lpapi -lsde -ltestlib

Author Checklist

  • Description
    Why this PR exists. Reference all relevant information, including background, issues, test failures, etc
  • Commits
    Commits are self contained and only do one thing
    Commits have a header of the form: module: short description
    Commits have a body (whenever relevant) containing a detailed description of the addressed problem and its solution
  • Tests
    The PR needs to pass all the tests

@gcongiu gcongiu merged commit ee97a32 into icl-utk-edu:master Sep 18, 2023
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants