Open hcOnel opened 10 months ago
Hey @hcOnel, I was able to solve this issue by using a earlier version of the repo. In an earlier version, you compile after you cd to the release
directory with the command make OS=LINUX MAIN=main
.
@EtorArza thanks for your suggestion. By changing the definitions as follows:
FCOMPILER = gfortran-10
CCOMPILER = g++-10
LGFORTRAN = -L/usr/lib/gcc/x86_64-linux-gnu/10/ -I/usr/lib/gcc/x86_64-linux-gnu/10/
I've managed to advance up to CREATE_LIB
. But now, I'm getting numerous multiple definition
and first defined here
messages. My make log is as follows (I've trimmed most of the definition messages to shorten it)
make COMPILE;
make[1]: Entering directory '/home/hconel/WindFLO/src'
make[1]: Nothing to be done for 'COMPILE'.
make[1]: Leaving directory '/home/hconel/WindFLO/src'
make LINKALL;
make[1]: Entering directory '/home/hconel/WindFLO/src'
g++-10 octree.o terrain.o WindFLO_f.o WindFLO.o wakeModels.o sobol.o ambientWindModels.o turbine.o costModels.o convexHull.o userDefined.o CubicSpline.o API.o main.o -L/usr/lib/gcc/x86_64-linux-gnu/10/ -I/usr/lib/gcc/x86_64-linux-gnu/10/ -g -lgfortran -o ../release/WindFLO
make[1]: Leaving directory '/home/hconel/WindFLO/src'
make CREATE_LIB;
make[1]: Entering directory '/home/hconel/WindFLO/src'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a(_muldi3.o): in function `__multi3':
(.text+0x0): multiple definition of `__multi3'; /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a(_muldi3.o):(.text+0x0): first defined here
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a(_negdi2.o): in function `__negti2':
(.text+0x0): multiple definition of `__negti2'; /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a(_negdi2.o):(.text+0x0): first defined here
...
...
...
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a(morestack.o): in function `__morestack_set_guard':
(.text+0x167): multiple definition of `__morestack_set_guard'; /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a(morestack.o):(.text+0x167): first defined here
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a(morestack.o): in function `__morestack_make_guard':
(.text+0x171): multiple definition of `__morestack_make_guard'; /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a(morestack.o):(.text+0x171): first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:113: CREATE_LIB] Error 1
make[1]: Leaving directory '/home/hconel/WindFLO/src'
make: *** [Makefile:55: BUILD] Error 2
I still can't pinpoint the source of the problem
Yeah, I also get this error when compiling the current version in linux. I managed to make it work by using an earlier version.
On Wed, Feb 21, 2024, 23:10 Huseyin C. Onel @.***> wrote:
@EtorArza https://github.com/EtorArza thanks for your suggestion. By changing the definitions as follows:
FCOMPILER = gfortran-10 CCOMPILER = g++-10 LGFORTRAN = -L/usr/lib/gcc/x86_64-linux-gnu/10/ -I/usr/lib/gcc/x86_64-linux-gnu/10/
I've managed to advance up to CREATE_LIB. But now, I'm getting numerous multiple definition and first defined here messages. My make log is as follows (I've trimmed most of the definition messages to shorten it)
make COMPILE; make[1]: Entering directory '/home/hconel/WindFLO/src' make[1]: Nothing to be done for 'COMPILE'. make[1]: Leaving directory '/home/hconel/WindFLO/src' make LINKALL; make[1]: Entering directory '/home/hconel/WindFLO/src' g++-10 octree.o terrain.o WindFLO_f.o WindFLO.o wakeModels.o sobol.o ambientWindModels.o turbine.o costModels.o convexHull.o userDefined.o CubicSpline.o API.o main.o -L/usr/lib/gcc/x86_64-linux-gnu/10/ -I/usr/lib/gcc/x86_64-linux-gnu/10/ -g -lgfortran -o ../release/WindFLO make[1]: Leaving directory '/home/hconel/WindFLO/src' make CREATE_LIB; make[1]: Entering directory '/home/hconel/WindFLO/src' /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a(_muldi3.o): in function
__multi3': (.text+0x0): multiple definition of
multi3'; /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a(_muldi3.o):(.text+0x0): first defined here /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a(_negdi2.o): in function `negti2': (.text+0x0): multiple definition of `__negti2'; /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a(_negdi2.o):(.text+0x0): first defined here... ... ...
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a(morestack.o): in function
__morestack_set_guard': (.text+0x167): multiple definition of
morestack_set_guard'; /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a(morestack.o):(.text+0x167): first defined here /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a(morestack.o): in function `morestack_make_guard': (.text+0x171): multiple definition of `__morestack_make_guard'; /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a(morestack.o):(.text+0x171): first defined here collect2: error: ld returned 1 exit status make[1]: [Makefile:113: CREATE_LIB] Error 1 make[1]: Leaving directory '/home/hconel/WindFLO/src' make: [Makefile:55: BUILD] Error 2I still can't pinpoint the source of the problem
— Reply to this email directly, view it on GitHub https://github.com/sohailreddy/WindFLO/issues/2#issuecomment-1958097971, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKWFANNVOYH2QKHNOICNICTYUZWHDAVCNFSM6AAAAABA6OSCUKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJYGA4TOOJXGE . You are receiving this because you were mentioned.Message ID: @.***>
The only release I see is this one: https://github.com/sohailreddy/WindFLO/releases/tag/v1.0.0 Is the version you've mentioned older? Can you share it?
I think the version in the other branch should work: https://github.com/sohailreddy/WindFLO/tree/WindFLO-v2.0.0
it has the release
folder I mentioned and compiles with make OS=LINUX MAIN=main
once you cd release
. Let me know if it works. To be specific, I am using the version in https://github.com/JudithEtxebarrieta/OPTECOT/tree/main/WindFLO but I think we took the code from the branch https://github.com/sohailreddy/WindFLO/tree/WindFLO-v2.0.0.
Apparently there were some issues with using gcc10 ++ I pushed a fix and tested with gcc10, 11 and 13 Can you try the latest master (with gcc11) and let me know if you are able to compile it.
I've downloaded the latest master branch and tried compiling it with g++-10
and g++-11
. I get the same multiple definition warnings and the error as before:
With g++-10:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a(generic-morestack.o): in function `__morestack_fail':
(.text+0x0): multiple definition of `__morestack_fail'; /usr/lib/gcc/x86_64-linux-gnu/10/libgcc.a(generic-morestack.o):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:110: CREATE_LIB] Error 1
make: *** [Makefile:52: BUILD] Error 2
With g++-11:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/libgcc.a(generic-morestack.o): in function `__morestack_fail':
(.text+0x0): multiple definition of `__morestack_fail'; /usr/lib/gcc/x86_64-linux-gnu/11/libgcc.a(generic-morestack.o):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:110: CREATE_LIB] Error 1
make: *** [Makefile:52: BUILD] Error 2
(you said gcc
but I guess you meant g++
?)
I'm on Ubuntu 22.04 and the complete make log is attached: log.make.txt Can you please suggest a specific Makefile configuration? I can't pinpoint my mistake.
Note: I've tried compiling with an older version of GCC (gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
) on Ubuntu 18.04 and got this message after "first defined here" messages:
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libc_nonshared.a(elf-init.oS): relocation R_X86_64_PC32 against undefined hidden symbol `__init_array_start' can not be used when making a shared object
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Makefile:108: recipe for target 'CREATE_LIB' failed
make[1]: *** [CREATE_LIB] Error 1
make[1]: Leaving directory '/home/hconel/WindFLO-test/src'
Makefile:49: recipe for target 'BUILD' failed
make: *** [BUILD] Error 2
Hi, As instructed, I modify the compilers in the
Makefile
as the following:and run make as:
I get the following output with errors:
Is this caused by the compiler version I'm using? Thanks in advance.