/usr/bin/ld: cannot find -lXmu - 32bit-64bit

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

Related

Installing R 3.5.0 with --enable-R-shlib

I am trying to install R 3.5.0 from source with the flag --enable-R-shlib under Linux Mint. Configuring and installing it without the flag works fine, but RStudio requires the flag to be set. However, when running
./configure --enable-R-shlib
make
I get the error
/usr/bin/ld: CommandLineArgs.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
CommandLineArgs.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:177: recipe for target 'libR.so' failed
make[3]: *** [libR.so] Error 1
make[3]: Leaving directory '/home/hps/Downloads/R-3.5.0/src/main'
Makefile:135: recipe for target 'R' failed
make[2]: *** [R] Error 2
make[2]: Leaving directory '/home/hps/Downloads/R-3.5.0/src/main'
Makefile:28: recipe for target 'R' failed
make[1]: *** [R] Error 1
make[1]: Leaving directory '/home/hps/Downloads/R-3.5.0/src'
Makefile:60: recipe for target 'R' failed
make: *** [R] Error 1
I tried setting the -fPIC flag as mentioned in the error message following the advice from [1]
CC="gcc -fPIC" ./configure --enable-R-shlib
to no avail, I still get the same error message.
[1] Passing a gcc flag through makefile
After adding these PPAs for Ubuntu, I was able to update R to 3.5.0 for my Linux Mint 17.3 Rosa.
sudo add-apt-repository ppa:marutter/rrutter3.5
sudo add-apt-repository ppa:marutter/c2d4u
sudo apt-get update
Ref: https://cran.r-project.org/bin/linux/ubuntu/
Edit: To compile from source, follow the suggestion here
sudo apt-get update
sudo apt-get build-dep r-base
wget https://cran.r-project.org/src/base/R-3/R-3.5.0.tar.gz
tar -xvf R-3.5.0.tar.gz
cd R-3.5.0
./configure --enable-R-shlib
make
Just in case someone else runs into this problem.
The issue is the object files ".o" are already compiled without the -fpic option.
The proper solution is to remove the object files from the first build and recomplile:
make clean
./configure --enable-R-shlib
make -j 4
sudo make install
The -j 4 tells make to spawn four compile processes at a time. Adjust the number to match the number of processor cores.

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/local/lib: file not recognized: Is a directory

When installing justniffer on CentOS 6.5,
./configure
works fine, but make gives the following error:
libtool: link: g++ -g -O2 -o justniffer justniffer-main.o justniffer-formatter.o justniffer-utilities.o justniffer-regex.o justniffer-prog_read_file.o /usr/local/lib -L/root/justniffer/lib/libnids-1.21_patched/src -lnids2 -lpcap -L/usr/local/lib -lboost_regex-mt -lboost_program_options -lpython2.6
/usr/local/lib: file not recognized: Is a directory
collect2: ld returned 1 exit status
make[1]: *** [justniffer] Error 1
make[1]: Leaving directory `/root/justniffer/src'
make: *** [all-recursive] Error 1
What's the solution for this?
use./configure LIBS="-I /usr/local/include -L/usr/local/lib" ,then make,it's work!
Having not compile program for so long time, made the same silly mistake:
Like CFLAGS, LIBS, GTK_LIBS etc should be flags e.g. -Lpath, not bare paths. What I used to do is relocate all DIRs to CFLAGS=/I/L Another way to
Spaces should be quoted or escaped like LIBS="-L'c/program files/gtk+/lib'"
LIBS="-Lc/program\ files/gtk+/lib"
vi Makefile and src/Makefile
LIBS = -pthread -lm -lz -ldl -lutil
make & make install
Success!

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!

Installing Rmpi on Centos6 'can't find -lmpi'

Hey I have seen the following two questions here:
Install Rmpi on Centos fails with "can't find -lmpi"
Installing Rmpi on LAM/MPI cluster
But they don't provide any concrete answer to the problem.
The following is some pertinent information:
R> system('echo "$LD_LIBRARY_PATH"')
/usr/lib64/R/lib:/usr/local/lib64:/usr/lib/jvm/jre/lib/amd64/server:/usr/lib/jvm/jre/lib/amd64:/usr/lib/jvm/java/lib/amd64:/usr/java/packages/lib/amd64:/lib:/usr/lib:/usr/lib64/openmpi/lib
R> install.packages("Rmpi", configure.args="--with-Rmpi-include=/usr/include/openmpi-x86_64 --with-Rmpi-libpath=/usr/lib64/openmpi --with-Rmpi-type=OPENMPI")
This is the last part of the error message:
gcc -m64 -std=gnu99 -shared -L/usr/local/lib64 -o Rmpi.so RegQuery.o Rmpi.o conversion.o internal.o -L/usr/lib64/openmpi -lmpi -L/usr/lib64/R/lib -lR
/usr/bin/ld: cannot find -lmpi
collect2: ld returned 1 exit status
make: *** [Rmpi.so] Error 1
Any help will be great. Thanks.
After installing openmpi-devel,
I see libmpi.so in /usr/lib64/openmpi/lib/.
$ sudo yum install openmpi-devel
$ sudo updatedb
$ locate libmpi.so
/usr/lib64/openmpi/lib/libmpi.so
/usr/lib64/openmpi/lib/libmpi.so.1
/usr/lib64/openmpi/lib/libmpi.so.1.0.2
The following should work:
install.packages(
"Rmpi",
configure.args = paste(
"--with-Rmpi-include=/usr/include/openmpi-x86_64",
"--with-Rmpi-libpath=/usr/lib64/openmpi/lib",
"--with-Rmpi-type=OPENMPI"
)
)
If may be necessary to tell the system to look for shared libraries in this directory, as well:
# echo "/usr/lib64/openmpi/lib" > /etc/ld.so.conf.d/openmpi.conf
# ldconfig

Resources