jtdx-project / jtdx

JTDX
Other
95 stars 43 forks source link

Building from source on linux error #7

Closed Alosnah closed 3 years ago

Alosnah commented 4 years ago

Installing using the INSTALL information produced this error:

$ cmake --build . [ 0%] Automatic MOC for target wsjt_cxx [ 0%] Built target wsjt_cxx_autogen [ 2%] Built target wsjt_cxx [ 2%] Automatic MOC for target wsjt_fort [ 2%] Built target wsjt_fort_autogen [ 37%] Built target wsjt_fort [ 37%] Automatic MOC for target ft8sim_gfsk [ 37%] Built target ft8sim_gfsk_autogen [ 37%] Built target ft8sim_gfsk [ 37%] Automatic MOC for target ft8sim [ 37%] Built target ft8sim_autogen [ 38%] Built target ft8sim [ 39%] Automatic MOC for target wsprsim [ 39%] Built target wsprsim_autogen [ 40%] Built target wsprsim [ 40%] Automatic MOC for target ft4sim [ 40%] Built target ft4sim_autogen [ 40%] Built target ft4sim [ 40%] Automatic MOC for target jt65sim [ 40%] Built target jt65sim_autogen [ 40%] Built target jt65sim [ 40%] Automatic MOC for target wsjt_qtmm [ 40%] Built target wsjt_qtmm_autogen [ 40%] Built target wsjt_qtmm [ 40%] Automatic MOC for target udp_daemon [ 40%] Built target udp_daemon_autogen [ 41%] Built target udp_daemon [ 41%] Automatic MOC for target jt9sim [ 41%] Built target jt9sim_autogen [ 41%] Built target jt9sim [ 41%] Automatic MOC for target jt9code [ 41%] Built target jt9code_autogen [ 42%] Built target jt9code [ 42%] Automatic MOC for target jt10sim [ 42%] Built target jt10sim_autogen [ 43%] Built target jt10sim [ 43%] Automatic MOC for target wsprd [ 43%] Built target wsprd_autogen [ 43%] Linking CXX executable wsprd /usr/bin/ld: CMakeFiles/wsprd.dir/lib/wsprd/jelinek.c.o:(.bss.stack+0x0): multiple definition of `stack'; CMakeFiles/wsprd.dir/lib/wsprd/wsprd.c.o:(.bss.stack+0x0): first defined here collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/wsprd.dir/build.make:265: wsprd] Error 1 make[1]: [CMakeFiles/Makefile2:630: CMakeFiles/wsprd.dir/all] Error 2 make: *** [Makefile:171: all] Error 2

sp2l commented 4 years ago

Hello Aloshah

JTDX source uses Fortran 9.0 Therefore it will NOT compile cleanly on systems with Fortran higher than that, for instance 10.x From provided error, I see it is exactly the case.

Best regards.

-- Tom - SP2L

It is nice to be important. But it is more important to be nice! Nobody is mistaken - so do I.

W dniu 2020-09-05 o 11:35, Alosnah pisze:

Installing using the INSTALL information produced this error:

$ cmake --build . [ 0%] Automatic MOC for target wsjt_cxx [ 0%] Built target wsjt_cxx_autogen [ 2%] Built target wsjt_cxx [ 2%] Automatic MOC for target wsjt_fort [ 2%] Built target wsjt_fort_autogen [ 37%] Built target wsjt_fort [ 37%] Automatic MOC for target ft8sim_gfsk [ 37%] Built target ft8sim_gfsk_autogen [ 37%] Built target ft8sim_gfsk [ 37%] Automatic MOC for target ft8sim [ 37%] Built target ft8sim_autogen [ 38%] Built target ft8sim [ 39%] Automatic MOC for target wsprsim [ 39%] Built target wsprsim_autogen [ 40%] Built target wsprsim [ 40%] Automatic MOC for target ft4sim [ 40%] Built target ft4sim_autogen [ 40%] Built target ft4sim [ 40%] Automatic MOC for target jt65sim [ 40%] Built target jt65sim_autogen [ 40%] Built target jt65sim [ 40%] Automatic MOC for target wsjt_qtmm [ 40%] Built target wsjt_qtmm_autogen [ 40%] Built target wsjt_qtmm [ 40%] Automatic MOC for target udp_daemon [ 40%] Built target udp_daemon_autogen [ 41%] Built target udp_daemon [ 41%] Automatic MOC for target jt9sim [ 41%] Built target jt9sim_autogen [ 41%] Built target jt9sim [ 41%] Automatic MOC for target jt9code [ 41%] Built target jt9code_autogen [ 42%] Built target jt9code [ 42%] Automatic MOC for target jt10sim [ 42%] Built target jt10sim_autogen [ 43%] Built target jt10sim [ 43%] Automatic MOC for target wsprd [ 43%] Built target wsprd_autogen [ 43%] Linking CXX executable wsprd /usr/bin/ld: CMakeFiles/wsprd.dir/lib/wsprd/jelinek.c.o:(.bss.stack+0x0): multiple definition of `stack'; CMakeFiles/wsprd.dir/lib/wsprd/wsprd.c.o:(.bss.stack+0x0): first defined here collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/wsprd.dir/build.make:265: wsprd] Error 1 make[1]: [CMakeFiles/Makefile2:630: CMakeFiles/wsprd.dir/all] Error 2 make: *** [Makefile:171: all] Error 2

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jtdx-project/jtdx/issues/7, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJZAXPYHCSMTN7R3C2MCBLTSEIA5ZANCNFSM4Q2VRGAQ.

-- Ta wiadomość została sprawdzona na obecność wirusów przez oprogramowanie antywirusowe Avast. https://www.avast.com/antivirus

Alosnah commented 4 years ago

Hello sp2l

Tried compiling with Fortran 9.3 (was the closest one I found), but that didn't work either...

Guess I have to stick to the JTDX provided in the AUR repository.

Thank you for responding so quickly.

73 de LA1ZOA - Hans

[ 44%] Building C object CMakeFiles/wsprd.dir/lib/wsprd/fano.c.o [ 44%] Building C object CMakeFiles/wsprd.dir/lib/wsprd/jelinek.c.o [ 44%] Building C object CMakeFiles/wsprd.dir/lib/wsprd/tab.c.o [ 45%] Building C object CMakeFiles/wsprd.dir/lib/wsprd/nhash.c.o [ 45%] Building C object CMakeFiles/wsprd.dir/lib/init_random_seed.c.o [ 45%] Building Fortran object CMakeFiles/wsprd.dir/lib/indexx.f90.o [ 45%] Building Fortran object CMakeFiles/wsprd.dir/lib/wsprd/osdwspr.f90.o [ 45%] Linking CXX executable wsprd /usr/bin/ld: CMakeFiles/wsprd.dir/lib/wsprd/jelinek.c.o:(.bss.stack+0x0): multiple definition of `stack'; CMakeFiles/wsprd.dir/lib/wsprd/wsprd.c.o:(.bss.stack+0x0): first defined here collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/wsprd.dir/build.make:265: wsprd] Error 1 make[1]: [CMakeFiles/Makefile2:630: CMakeFiles/wsprd.dir/all] Error 2 make: *** [Makefile:171: all] Error 2

alexander-pick commented 3 years ago

Got the same error here. Fortran is not the issue.

Edit/Possible Solution

I looked in the code and it is indeed a duplicate definition. There is a pointer called stack defined in the header jelinek.h, this header gets included into wsprd.c and jelinek.c, causing the duplicate definition error. The header guard is not solving this as both are compiled as own objects and the error occurs during linking.

I moved this global declaration of stack to jelinek.c and changed the original declaration in the header to extern.

That seems to work for this issue, just successfully compiled the project on Ubuntu 20.10/aarch64.