gnatmake linked failed on MacOS - ada

I was trying to compile an ada program using gnat but I got this error:
(base) alexandretrotel#MacBook-Pro TP1 % gnatmake Exercice6.adb
gcc -c exercice6.adb
gnatbind -x exercice6.ali
gnatlink exercice6.ali
ld: library not found for -lSystem
collect2: error: ld returned 1 exit status
gnatlink: error when calling /Users/alexandretrotel/opt/GNAT/2020/bin/gcc
gnatmake: *** link failed.

Related

Error while building R from source with gcc OpenMP support

I am trying to compile R in a Redhat linux environment on a HPC cluster. I have used environment modules to install recent versions of a number of tools including GCC 5.2.0. I cannot get R to build from the source. It fails with undefined reference to `GOMP_parallel'. When I compile with the --disable-openmp option it compiles fine.
array.o: In function `do_colsum':
array.c:(.text+0x5829): undefined reference to `GOMP_parallel'
collect2: error: ld returned 1 exit status
make[3]: *** [R.bin] Error 1
make[3]: Leaving directory `/scratch/kokul/240763.hpc5/R- 3.2.3/src/main'
make[2]: *** [R] Error 2
make[2]: Leaving directory `/scratch/kokul/240763.hpc5/R- 3.2.3/src/main'
make[1]: *** [R] Error 1
make[1]: Leaving directory `/scratch/kokul/240763.hpc5/R-3.2.3/src'
make: *** [R] Error 1
A couple of questions
What are the advantages of having openMP enabled, I am assuming this will enhance the performance?
How do I fix the error I encounter while building? Is this related to linking the correct library? -fopenmp is correctly used while building. libgomp.* files are also in the $LIBRARY_PATH and $LD_LIBRARY_PATH.
It might be a simple thing I am missing, but I have tried to search for a proper answer without success.
Advanced thanks for any help.
I am having the same problem:
gcc -Wl,--export-dynamic -fopenmp -L/usr/local/lib -o R.bin Rmain.o CommandLineArgs.o Rdynload.o Renviron.o RNG.o agrep.o apply.o arithmetic.o array.o attrib.o bind.o builtin.o character.o coerce.o colors.o complex.o connections.o context.o cum.o dcf.o datetime.o debug.o deparse.o devices.o dotcode.o dounzip.o dstruct.o duplicate.o edit.o engine.o envir.o errors.o eval.o format.o gevents.o gram.o gram-ex.o graphics.o grep.o identical.o inlined.o inspect.o internet.o iosupport.o lapack.o list.o localecharset.o logic.o main.o mapply.o match.o memory.o names.o objects.o options.o paste.o platform.o plot.o plot3d.o plotmath.o print.o printarray.o printvector.o printutils.o qsort.o radixsort.o random.o raw.o registration.o relop.o rlocale.o saveload.o scan.o seq.o serialize.o sort.o source.o split.o sprintf.o startup.o subassign.o subscript.o subset.o summary.o sysutils.o times.o unique.o util.o version.o g_alab_her.o g_cntrlify.o g_fontdb.o g_her_glyph.o xxxpr.o ls ../unix/*.o ../appl/*.o ../nmath/*.o ../extra/tre/libtre.a -L../../lib -lRblas -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -lgfortran -lm -lquadmath -lreadline -lpcre -llzma -lbz2 -lz -lrt -ldl -lm
array.o: In function do_colsum':
/home/myaccount/Downloads/R-patched/src/main/array.c:1437: undefined reference toGOMP_parallel'
collect2: error: ld returned 1 exit status
Makefile:144: recipe for target 'R.bin' failed
This is a configuration problem from R (autotools problem). My computer has both gcc 4.8 (came with OS) and the latest version gcc 5.2 (I build from source). The gcc 5.2 is located in /usr/local
I saw that R is mixing these two up, and not picking up the 5.2 library locations.
I changed the Makefile (this is only one time fix since the make file is generated by the autotool).
First go to src/main directory. Then edit the Makefile:
143 $(R_binary): $(R_bin_OBJECTS) $(R_bin_DEPENDENCIES)
144 $(MAIN_LINK) -o $# $(R_bin_OBJECTS) $(R_bin_LDADD)
Edite line 144:
144 $(MAIN_LINK) -o $# $(R_bin_OBJECTS) -L/usr/local/lib64 -lgomp $(R_bin_LDADD)
This fixed my problem. I had a hard time filing a bug with the R project. If the R developers saw this, could they fix this at the auto configure level? The auto probing just have to be a little bit smarter.

/usr/bin/ld: cannot find -lXmu

I want to install netgen and try to compile the source code.
During this I got the error message:
U -L/usr/lib/x86_64-linux-gnu -ltk8.6 -ltcl8.6 -lGL -lXmu -lX11 -fopenmp -Wl,-rpath -Wl,/opt/netgen/lib
/usr/bin/ld: cannot find -lXmu
collect2: error: ld returned 1 exit status
make[2]: *** [netgen] Error 1
Maybe I have to install an additional package?
Does anyone have an idea?
You can check, depending on your specific OS, if you are not missing the missing the non-versioned named (i.e. libXmu.so).
Check for ls /usr/lib/libXmu*.*, and if not found, type:
ln -s /usr/lib/libXmu.so libXmu.so.6
ln -s /usr/lib/libXuu.so libXmuu.so.1
If you don't have any libXmu*.* files, then you need to install first libxmu-dev:
sudo apt-get install libxmu-dev

WKHTMLTOPDF with Patched QT Ubuntu 14.04 Errors during compiling

I am trying to compile the wkhtmltopdf with patched qt using these instructions and when i get to the make && make install it gives me an error has anyone else done this on Ubuntu 14.04? I can't figure out what to do from here.
these are the instructions i am following i know they are not for 14.04 but i hoped they would have worked https://gist.github.com/Zauberfisch/8773593
This is the error i get:
cd src/lib/ && make -f Makefile make[1]: Entering directory /temp/wkhtmltopdf/src/lib' rm -f libwkhtmltox.so.0.12.1 libwkhtmltox.so libwkhtmltox.so.0 libwkhtmltox.so.0.12 g++ -Wl,-O1 -Wl,-rpath,/temp/wkqt/lib -shared -Wl,-soname,libwkhtmltox.so.0 -o libwkhtmltox.so.0.12.1 ../../build/loadsettings.o ../../build/multipageloader.o ../../build/tempfile.o ../../build/converter.o ../../build/websettings.o ../../build/reflect.o ../../build/utilities.o ../../build/pdfsettings.o ../../build/pdfconverter.o ../../build/outline.o ../../build/tocstylesheet.o ../../build/imagesettings.o ../../build/imageconverter.o ../../build/pdf_c_bindings.o ../../build/image_c_bindings.o ../../build/moc_multipageloader_p.o ../../build/moc_converter_p.o ../../build/moc_pdfconverter_p.o ../../build/moc_imageconverter_p.o ../../build/moc_pdf_c_bindings_p.o ../../build/moc_image_c_bindings_p.o ../../build/moc_converter.o ../../build/moc_multipageloader.o ../../build/moc_utilities.o ../../build/moc_pdfconverter.o ../../build/moc_imageconverter.o ../../build/qrc_wkhtmltopdf.o -L/temp/wkqt/lib -lQtWebKit -lQtSvg -L/temp/wkqt/lib -L/usr/X11R6/lib -lQtXmlPatterns -lQtGui -lQtNetwork -lQtCore -lpthread /usr/bin/ld: ../../build/qrc_wkhtmltopdf.o: relocation R_X86_64_32 against.rodata' can not be used when making a shared object; recompile with -fPIC ../../build/qrc_wkhtmltopdf.o: error adding symbols: Bad value collect2: error: ld returned 1 exit status make[1]: * [../../bin/libwkhtmltox.so.0.12.1] Error 1 make[1]: Leaving directory `/temp/wkhtmltopdf/src/lib' make: * [sub-src-lib-make_default-ordered] Error 2
I downloaded a binary from their site that already had the QT build and that fixed the issue for me. Thanks!

Error while testing QT test project

I have started using QT on Kubuntu. I first installed g++ via Package Manager. Then I installed QT 5.0.1. I then made a test project to check if everything is correct or not. Then I got following issues.
- cannot find -lGL
- collect2: error:Id returned 1 exit status
I saw in Compile Output
11:32:05: Running steps for project untitled2...
11:32:05: Configuration unchanged, skipping qmake step.
11:32:05: Starting: "/usr/bin/make" -w
make: Entering directory `/home/harsh/Desktop/untitled2-build-Desktop_Qt_5_0_1_GCC_64bit-Debug'
g++ -m64 -Wl,-rpath,/home/harsh/Qt5.0.1/5.0.1/gcc_64 -Wl,-rpath,/home/harsh/Qt5.0.1/5.0.1/gcc_64/lib -o untitled2 main.o mainwindow.o moc_mainwindow. -L/usr/X11R6/lib64 -L/home/harsh/Qt5.0.1/5.0.1/gcc_64/lib -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread
/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
make: *** [untitled2] Error 1
make: Leaving directory `/home/harsh/Desktop/untitled2-build-Desktop_Qt_5_0_1_GCC_64bit-Debug'
11:32:05: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project untitled2 (kit: Desktop Qt 5.0.1 GCC 64bit)
When executing step 'Make'
Please help me fix these errors.
Qt != QT
The error tells you what is wrong, the compiler cannot find libGL.so. It's usually in /usr/lib64.

Qt Creator Project Build Error

I get the following error when building a project in Qt Creator:
**error: collect2: ld returned 1 exit status**
Below is the compile output
**Running build steps for project mw_fe...**
Starting: F:/Qt/2009.04/qt/bin/qmake.exe C:/Documents and Settings/Administrator/My Documents/mw_fe/mw_fe.pro -spec win32-g++ -r CONFIG+=release
Exited with code 0.
Starting: F:/Qt/2009.04/mingw/bin/mingw32-make.exe -w
mingw32-make: Entering directory `C:/Documents and Settings/Administrator/My Documents/mw_fe'
F:/Qt/2009.04/mingw/bin/mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `C:/Documents and Settings/Administrator/My Documents/mw_fe'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,console -o release\mw_fe.exe release/main.o release/mamewah.o release/moc_mamewah.o -L"f:\Qt\2009.04\qt\lib" -lQtDBus -lQtTest4 -lQtScript4 -lQtXmlPatterns4 -lQtXml4 -lQtGui4 -lQtCore4
mingw32-make[1]: Leaving directory `C:/Documents and Settings/Administrator/My Documents/mw_fe'
mingw32-make: Leaving directory `C:/Documents and Settings/Administrator/My Documents/mw_fe'
f:\Qt\2009.04\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot find -lQtDBus
collect2: ld returned 1 exit status
mingw32-make[1]: *** [release\mw_fe.exe] Error 1
mingw32-make: *** [release] Error 2
Exited with code 2.
Error while building project mw_fe
When executing build step 'Make'
Please help me...
Thanks.
cannot find -lQtDBus
The QtDBus module is a Unix-only library. In theory it's possible to compile winDBus and then QtDBus for Windows. But it's not easy and I'm not sure about MinGW...

Resources