Yet another Undefined symbols for architecture x86_64 - c

I am stuck with this error:
mpif90 -o /Users/manfredo/Desktop/ED2/ED/build/ed_2.1-opt edmain.o -L/opt/local/lib/libgcc/ -lstdc++ -I/Users/manfredo/Desktop/ED2/ED/src/include -I/opt/local/include /Users/manfredo/Desktop/ED2/ED/build/ed_2.1-opt.a -lm -lz -L/opt/local/lib -lhdf5 -lhdf5_fortran
Undefined symbols for architecture x86_64:
"_calchydrosubsurface_", referenced from:
_ed_model_ in ed_2.1-opt.a(ed_model.o)
...
other similar errors
...
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[1]: *** [/Users/manfredo/Desktop/ED2/ED/build/ed_2.1-opt] Error 1
make: *** [all] Error 2
I have tried adding -stdlib=libstdc++ or including the libraries lstdc++ or lstc++.6 as suggested here or here and I had already posted a question about the same error but still not able to fix it.
The compilation with mpif is needed. Any help will be appreciated.

Related

"undefined reference" reported when performing rpmbuild on rhel8, different gcc linker behaviour on x86_64 and s390x?

I'm trying to install the mlnx ofed on rhel8 from the source (MLNX_OFED_SRC-5.0-2.1.8.0.tgz) (x86_64 and s390x respectively), the installation on x86_64 has no issues, but on s390x the installation reports "undefined reference" error.
+ /usr/bin/make
/usr/bin/make all-am
make[1]: Entering directory '/var/tmp/OFED_topdir/BUILD/perftest-4.4'
CC src/get_clock.o
In file included from /usr/include/sys/time.h:21,
from src/get_clock.c:43:
/usr/include/features.h:184:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
^~~~~~~
CC src/perftest_communication.o
CC src/perftest_parameters.o
CC src/perftest_resources.o
CC src/perftest_counters.o
CC src/raw_ethernet_resources.o
AR libperftest.a
CC src/send_bw.o
CC src/multicast_resources.o
CCLD ib_send_bw
/usr/lib/gcc/s390x-redhat-linux/8/../../../../lib64/libmlx5.a(verbs.c.o): In function `create_cq':
(.text+0x860): undefined reference to `rdmacore28_0_ibv_cmd_create_cq'
(.text+0x912): undefined reference to `rdmacore28_0_ibv_cmd_create_cq_ex'
/usr/lib/gcc/s390x-redhat-linux/8/../../../../lib64/libmlx5.a(verbs.c.o): In function `_mlx5_create_flow_action_esp':
(.text+0x9ba): undefined reference to `rdmacore28_0_ibv_cmd_create_flow_action_esp'
......................
/usr/lib/gcc/s390x-redhat-linux/8/../../../../lib64/libmlx5.a(mlx5.c.o): In function `drv__register_driver':
(.text.startup[.text.startup.group]+0x8): undefined reference to `rdmacore28_0_verbs_register_driver_25'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:711: ib_send_bw] Error 1
make[1]: Leaving directory '/var/tmp/OFED_topdir/BUILD/perftest-4.4'
make: *** [Makefile:552: all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.SFtR26 (%build)
rpmbuild log on s390x:
https://drive.google.com/file/d/1vSF8eRPLGP9eDWgQ2wrtWvqkm1R5_B-J/view?usp=sharing
rpmbuild log on x86_64:
https://drive.google.com/file/d/1SFGwmJBgh7Y8shL75Nr5NFVhcj_aqU-V/view?usp=sharing
I checked the both nm output for the mentioned object file (/usr/lib64/libmlx5.a) on both machine, not found any difference for the "undefined symbols" mentioned in the error log.
nm output on s390x:
https://drive.google.com/file/d/1Wu9kPX2R6w2_RDlAHvyG4Qre1JUXxThz/view?usp=sharing
nm output on x86_64:
https://drive.google.com/file/d/1xCATkGjhANXakEiYnu7td7orkuWeUkee/view?usp=sharing
So, what could be the reason? different gcc linker behaviour?
Regards
FuLong

ld: Mismatched Data ABI

When I am trying to compile a C code in HP-UX I am getting the following error :
gcc -g -O2 -o autocode /disk1/peru-dev/NIKIRATOOLS/FLEX/lib/hpux64/libfl.a grammer.o tokens.o pgen.o javapgen.o
ld: Mismatched Data ABI. Expected None but found EF_IA_64_ABI64 in file /disk1/peru-dev/NIKIRATOOLS/FLEX/lib/hpux64/libfl.a[libmain.o]
Fatal error.
collect2: ld returned 1 exit status
gmake[1]: *** [autocode] Error 1
I am not able to understand this "Mismatched Data ABI" error. Please help me out.

Undefined symbols argp_parse and arpg_usage when installing rng-tools on OSX

I am currently trying to install rng-tools on OSX, as I have a specific need for it to speed up a certain simulator that I am currently using. At first, I faced the problem of not having argp, so I installed argp-standalone from Homebrew. However, I still receive the following error message when trying to make rng-tools:
gcc -g -O2 -o rngtest stats.o rngtest.o librngd.a
Undefined symbols for architecture x86_64:
"_argp_parse", referenced from:
_main in rngtest.o
"_argp_usage", referenced from:
_parse_opt in rngtest.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[2]: *** [rngtest] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
I checked /usr/local/include/argp.h and it does seem to contain the correct function definitions referenced in rngtest.c, so any thoughts on what might be the problem?
I just needed rngtest which I managed to compile on OSX using this https://github.com/fproulx/rngtest (which also needs brew install argp-standalone). I made that into a homebrew formula which can be obtained here: https://github.com/oderwat/homebrew-experiments

c netbeans file was built for unsupported file format

Am trying to build a c program in netbeans on mac osx 10.7.5 and am getting the following error. I am not sure what is going on. I am trying to learn c.
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
nbproject/Makefile-Debug.mk:73: warning: overriding commands for target `build/Debug/GNU-MacOSX/UnsortedList.o'
nbproject/Makefile-Debug.mk:68: warning: ignoring old commands for target `build/Debug/GNU-MacOSX/UnsortedList.o'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-MacOSX/cs350_lab6_linkedlist
nbproject/Makefile-Debug.mk:73: warning: overriding commands for target `build/Debug/GNU-MacOSX/UnsortedList.o'
nbproject/Makefile-Debug.mk:68: warning: ignoring old commands for target `build/Debug/GNU-MacOSX/UnsortedList.o'
mkdir -p dist/Debug/GNU-MacOSX
gcc -o dist/Debug/GNU-MacOSX/cs350_lab6_linkedlist build/Debug/GNU-MacOSX/UnsortedList.o build/Debug/GNU-MacOSX/UnsortedList.o build/Debug/GNU-MacOSX/main.o
ld: warning: ignoring file build/Debug/GNU-MacOSX/UnsortedList.o, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: warning: ignoring file build/Debug/GNU-MacOSX/UnsortedList.o, file was built for unsupported file format which is not the architecture being linked (x86_64)
Undefined symbols for architecture x86_64:
"_CreateList", referenced from:
_main in main.o
"_InsertItem", referenced from:
_main in main.o
"_DeleteItem", referenced from:
_main in main.o
"_PrintList", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-MacOSX/cs350_lab6_linkedlist] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 71ms)
If i put all the methods definitions in the main file instead of writing separately in implementation file, then it's building fine and showing no error.

installing Postgis 1.5.2 with PostGres 9.0.3 fails

on Mac OS X Snow Leopard, I get the following error on make
gcc -g -O2 -fno-common -DPIC -Wall -Wmissing-prototypes stringbuffer.o shpopen.o dbfopen.o safileio.o getopt.o shp2pgsql-core.o shp2pgsql-cli.o ../liblwgeom/liblwgeom.a -o shp2pgsql -liconv -lm
Undefined symbols:
"_libiconv_open", referenced from:
_utf8 in shp2pgsql-core.o
"_libiconv_close", referenced from:
_utf8 in shp2pgsql-core.o
_utf8 in shp2pgsql-core.o
"_libiconv", referenced from:
_utf8 in shp2pgsql-core.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [shp2pgsql] Error 1
make: *** [loaderdumper] Error 2
What is the solution?
It seems there's some problem with libconv. Either it isn'l installed or it isn't correctly linked. Try installing it first.

Resources