I am trying to compile FormCalc 9.9 on a MacOS 10.10.5.
Compilation consists in running a bash script on terminal. I redirect both stdout and sterr to a log file, but this is all the output I get:
$ ./compile
Compiling for system type MacOSX-x86-64
cp -p ./bin/MacOSX-x86-64/* MacOSX-x86-64/
gcc -O3 -fomit-frame-pointer -ffast-math -Wall -Wextra -m64 -o MacOSX-x86-64/ToForm ./FormCalc/ToForm.c
./FormCalc/ToForm.c:72:9: warning: declaration does not declare anything [-Wmissing-declarations]
__attribute__ ((fallthrough));
^
>
1 warning generated.
strip MacOSX-x86-64/ToForm
gcc -O3 -fomit-frame-pointer -ffast-math -Wall -Wextra -m64 -o MacOSX-x86-64/ToFortran ./FormCalc/ToFortran.c
strip MacOSX-x86-64/ToFortran
gcc -O3 -fomit-frame-pointer -ffast-math -Wall -Wextra -m64 -o MacOSX-x86-64/ToC ./FormCalc/ToC.c
strip MacOSX-x86-64/ToC
gcc -O3 -fomit-frame-pointer -ffast-math -Wall -Wextra -m64 -o MacOSX-x86-64/reorder ./tools/reorder.c
strip MacOSX-x86-64/reorder
looking for gcc... /usr/bin/clang
looking for g++... /usr/bin/clang++
looking for fortran... /usr/local/bin/gfortran
extracting the Fortran libraries... ok
does gfortran append underscores... error linking Fortran and C
How can I get more information about the linking error?
I am having serious trouble compiling Qt with the OCI plugin.
The Qt version is 5.6.1, and the Oracle instant client version is 12.1.0.2.0. I have installed both the basic and SDK versions, as the Qt online manual asks.
I then try to run the following command:
./configure -I /usr/include/oracle/12.1/client64/ -L /usr/lib/oracle/12.1/client64/lib -prefix /online/daq/antonin/qt_build -plugin-sql-oci -qt-xcb -v
Which produces this output:
+ cd qtbase
+ /online/daq/antonin/qt_source/5.6/Src/qtbase/configure -top-level -I /usr/include/oracle/12.1/client64/ -L /usr/lib/oracle/12.1/client64/lib -prefix /online/daq/antonin/qt_build -plugin-sql-oci -qt-xcb -v
Which edition of Qt do you want to use ?
Type 'c' if you want to use the Commercial Edition.
Type 'o' if you want to use the Open Source Edition.
o
This is the Qt Open Source Edition.
You are licensed to use this software under the terms of
the Lesser GNU General Public License (LGPL) versions 2.1.
You are also licensed to use this software under the terms of
the GNU Lesser General Public License (LGPL) versions 3.
Type '3' to view the GNU Lesser General Public License version 3.
Type 'L' to view the Lesser GNU General Public License version 2.1.
Type 'yes' to accept this license offer.
Type 'no' to decline this license offer.
Do you accept the terms of either license? yes
Running configuration tests (phase 1)...
Precompiled-headers support enabled.
g++ -c -fvisibility=hidden fvisibility.c
Symbol visibility control enabled.
cc1plus: error: unrecognized command line option "-fuse-ld=gold"
g++ -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c
Symbolic function binding enabled.
DEFAULT_INCDIRS="/usr/include/c++/4.4.7
/usr/include/c++/4.4.7/x86_64-redhat-linux
/usr/include/c++/4.4.7/backward
/usr/local/include
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include
/usr/include
"
DEFAULT_LIBDIRS="/lib64
/usr/lib64
/online/daq/lib
/usr/lib
/lib
/usr/lib/gcc/x86_64-redhat-linux/4.4.7
"
Done running configuration tests.
Creating qmake...
gmake: Nothing to be done for `first'.
Running configuration tests (phase 2)...
Found pkg-config from $PATH: /usr/bin/pkg-config
Determining architecture... ()
g++ -c -pipe -g -std=gnu++0x -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../mkspecs/linux-g++ -o arch.o arch.cpp
g++ -o arch arch.o -L/usr/lib/oracle/12.1/client64/lib
Found architecture in binary
CFG_ARCH="x86_64"
CFG_CPUFEATURES=" mmx sse sse2"
System architecture: 'x86_64'
Host architecture: 'x86_64'
C++11 auto-detection... ()
g++ -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../../mkspecs/linux-g++ -o c++11.o c++11.cpp
g++ -Wl,-O1 -o c++11 c++11.o -L/usr/lib/oracle/12.1/client64/lib
C++11 enabled.
C++14 auto-detection... ()
g++ -c -pipe -O2 -std=gnu++1y -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../../mkspecs/linux-g++ -o c++14.o c++14.cpp
cc1plus: error: unrecognized command line option "-std=gnu++1y"
gmake: *** [c++14.o] Error 1
C++14 disabled.
default C++ standard edition auto-detection... ()
g++ -pipe -O2 -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../../mkspecs/linux-g++ -o c++default.ii -E c++default.cpp
default C++ standard edition enabled.
64-bit std::atomic auto-detection... ()
g++ -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../../mkspecs/linux-g++ -o atomic64.o atomic64.cpp
atomic64.cpp:34:18: error: atomic: No such file or directory
atomic64.cpp:37: error: expected unqualified-id before '<' token
atomic64.cpp:37: error: expected ')' before '<' token
atomic64.cpp:37: error: expected initializer before '<' token
gmake: *** [atomic64.o] Error 1
64-bit std::atomic disabled.
64-bit std::atomic in -latomic auto-detection... ()
g++ -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../../mkspecs/linux-g++ -o atomic64.o atomic64.cpp
atomic64.cpp:34:18: error: atomic: No such file or directory
atomic64.cpp:37: error: expected unqualified-id before '<' token
atomic64.cpp:37: error: expected ')' before '<' token
atomic64.cpp:37: error: expected initializer before '<' token
gmake: *** [atomic64.o] Error 1
64-bit std::atomic in -latomic disabled.
sse2 auto-detection... ()
g++ -c -pipe -msse2 -g -std=gnu++0x -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../../mkspecs/linux-g++ -o sse2.o sse2.cpp
g++ -o sse2 sse2.o -L/usr/lib/oracle/12.1/client64/lib
sse2 enabled.
sse3 auto-detection... ()
g++ -c -pipe -msse3 -g -std=gnu++0x -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../../mkspecs/linux-g++ -o sse3.o sse3.cpp
g++ -o sse3 sse3.o -L/usr/lib/oracle/12.1/client64/lib
sse3 enabled.
ssse3 auto-detection... ()
g++ -c -pipe -mssse3 -g -std=gnu++0x -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../../mkspecs/linux-g++ -o ssse3.o ssse3.cpp
g++ -o ssse3 ssse3.o -L/usr/lib/oracle/12.1/client64/lib
ssse3 enabled.
sse4_1 auto-detection... ()
g++ -c -pipe -msse4.1 -g -std=gnu++0x -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../../mkspecs/linux-g++ -o sse4_1.o sse4_1.cpp
g++ -o sse4_1 sse4_1.o -L/usr/lib/oracle/12.1/client64/lib
sse4_1 enabled.
sse4_2 auto-detection... ()
g++ -c -pipe -msse4.2 -g -std=gnu++0x -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../../mkspecs/linux-g++ -o sse4_2.o sse4_2.cpp
g++ -o sse4_2 sse4_2.o -L/usr/lib/oracle/12.1/client64/lib
sse4_2 enabled.
avx auto-detection... ()
g++ -c -pipe -mavx -g -std=gnu++0x -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../../mkspecs/linux-g++ -o avx.o avx.cpp
g++ -o avx avx.o -L/usr/lib/oracle/12.1/client64/lib
avx enabled.
avx2 auto-detection... ()
g++ -c -pipe -mavx2 -g -std=gnu++0x -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../../mkspecs/linux-g++ -o avx2.o avx2.cpp
cc1plus: error: unrecognized command line option "-mavx2"
gmake: *** [avx2.o] Error 1
avx2 disabled.
ipc_sysv auto-detection... ()
g++ -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../../mkspecs/linux-g++ -o ipc.o ipc.cpp
g++ -Wl,-O1 -o ipc_sysv ipc.o -L/usr/lib/oracle/12.1/client64/lib
ipc_sysv enabled.
zlib auto-detection... ()
g++ -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../../mkspecs/linux-g++ -o zlib.o zlib.cpp
g++ -Wl,-O1 -o zlib zlib.o -L/usr/lib/oracle/12.1/client64/lib -lz
zlib enabled.
mtdev auto-detection... ()
Project ERROR: mtdev development package not found
mtdev disabled.
libjpeg auto-detection... ()
g++ -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../../mkspecs/linux-g++ -o libjpeg.o libjpeg.cpp
libjpeg.cpp: In function 'int main(int, char**)':
libjpeg.cpp:43: warning: 'cinfo' is used uninitialized in this function
g++ -Wl,-O1 -o libjpeg libjpeg.o -L/usr/lib/oracle/12.1/client64/lib -ljpeg
libjpeg enabled.
libpng auto-detection... ()
g++ -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../../mkspecs/linux-g++ -o libpng.o libpng.cpp
g++ -Wl,-O1 -o libpng libpng.o -L/usr/lib/oracle/12.1/client64/lib -lpng
libpng enabled.
libdl auto-detection... ()
g++ -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../../mkspecs/linux-g++ -o libdl.o libdl.cpp
g++ -Wl,-O1 -o libdl libdl.o -L/usr/lib/oracle/12.1/client64/lib -ldl
libdl enabled.
DB2 auto-detection... ()
g++ -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../../mkspecs/linux-g++ -o db2.o db2.cpp
db2.cpp:34:20: error: sqlcli.h: No such file or directory
db2.cpp:35:21: error: sqlcli1.h: No such file or directory
gmake: *** [db2.o] Error 1
DB2 disabled.
InterBase auto-detection... ()
g++ -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../../mkspecs/linux-g++ -o ibase.o ibase.cpp
ibase.cpp:34:19: error: ibase.h: No such file or directory
gmake: *** [ibase.o] Error 1
InterBase disabled.
MySQL (thread-safe) auto-detection... ()
g++ -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -isystem /usr/include/mysql -I../../../mkspecs/linux-g++ -o mysql.o ../mysql/mysql.cpp
g++ -Wl,-O1 -o mysql_r mysql.o -L/usr/lib/oracle/12.1/client64/lib -L/usr/lib64/mysql -lz -lcrypt -lnsl -lm -lpthread -lssl -lcrypto -lmysqlclient_r
MySQL (thread-safe) enabled.
OCI auto-detection... ()
g++ -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -I. -isystem /usr/include/oracle/12.1/client64 -I../../../mkspecs/linux-g++ -o oci.o oci.cpp
g++ -Wl,-O1 -o oci oci.o -L/usr/lib/oracle/12.1/client64/lib -lclntsh
/usr/lib/oracle/12.1/client64/lib/libclntsh.so: undefined reference to `lxXmlCvEsc0'
/usr/lib/oracle/12.1/client64/lib/libclntsh.so: undefined reference to `lxXmlGEntEscImpl'
/usr/lib/oracle/12.1/client64/lib/libclntsh.so: undefined reference to `slnxmul'
/usr/lib/oracle/12.1/client64/lib/libclntsh.so: undefined reference to `zt_init'
/usr/lib/oracle/12.1/client64/lib/libclntsh.so: undefined reference to `slnxadd'
/usr/lib/oracle/12.1/client64/lib/libclntsh.so: undefined reference to `slnxsub'
collect2: ld returned 1 exit status
gmake: *** [oci] Error 1
OCI disabled.
Oracle (OCI) support cannot be enabled due to functionality tests!
Turn on verbose messaging (-v) to /online/daq/antonin/qt_source/5.6/Src/qtbase/configure to see the final report.
If you believe this message is in error you may use the continue
switch (-continue) to /online/daq/antonin/qt_source/5.6/Src/qtbase/configure to continue.
As you can see, there are several undefined references for one of the the OCI .so files. I have tried checking online, but I have found barely any references to these symbols.
Any idea what could be causing this? A missing .so file? Wrong version of the library?
I've downloaded dhex_0.69.tar.gz from http://www.dettus.net/dhex/ and unpacked it. The Readme says simply to run make.
When I try to build it in MSYS2 shell on Windows 10, compilation and linking proceed without any problems, I get an .exe, which works fine:
user#PC MSYS /d/src/dhex_0.69
$ make
gcc buffers.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc configfile.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc correlation.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc gpl.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc hexcalc.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc input.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc machine_type.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc main.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc markers.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc menu.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc output.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc search.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc ui.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc -L/usr/lib -L/usr/local/lib -L/usr/lib/ncurses -L/usr/local/lib/ncurses -o dhex buffers.o configfile.o correlation.o gpl.o hexcalc.o input.o machine_type.o main.o markers.o menu.o output.o search.o ui.o -lncurses
However, this .exe will then depend on msys-ncursesw6.dll and msys-2.0.dll when ran outside of the MSYS shell (so, when ran in Command Prompt cmd.exe, which does raise an error - or in Power Shell, which does not raise an error; the program simply exits there).
So, I wanted to try and build it in MINGW64. Compilation completes, but with warning - and linking fails due to undefined reference to '_impure_ptr':
user#PC MINGW64 /d/src/dhex_0.69
$ make
gcc buffers.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc configfile.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc correlation.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
correlation.c: In function 'find_longestmatch':
correlation.c:41:28: warning: unknown conversion type character 'l' in format [-Wformat=]
else fprintf(stderr,"%16lli\r",((tInt64)buf1->bufsize-pos1));
^
correlation.c:41:23: warning: too many arguments for format [-Wformat-extra-args]
else fprintf(stderr,"%16lli\r",((tInt64)buf1->bufsize-pos1));
^~~~~~~~~~
correlation.c: In function 'find_bestmatch':
correlation.c:129:28: warning: unknown conversion type character 'l' in format [-Wformat=]
else fprintf(stderr,"%16lli\r",((tInt64)buf1->bufsize-pos1));
^
correlation.c:129:23: warning: too many arguments for format [-Wformat-extra-args]
else fprintf(stderr,"%16lli\r",((tInt64)buf1->bufsize-pos1));
^~~~~~~~~~
correlation.c: In function 'find_mindiff':
correlation.c:210:28: warning: unknown conversion type character 'l' in format [-Wformat=]
else fprintf(stderr,"%16lli\r",((tInt64)buf1->bufsize-pos1));
^
correlation.c:210:23: warning: too many arguments for format [-Wformat-extra-args]
else fprintf(stderr,"%16lli\r",((tInt64)buf1->bufsize-pos1));
^~~~~~~~~~
gcc gpl.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc hexcalc.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc input.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
input.c: In function 'decinput':
input.c:116:27: warning: unknown conversion type character 'l' in format [-Wformat=]
snprintf(tmpbuf,21,"%20lli",newval);
^
input.c:116:22: warning: too many arguments for format [-Wformat-extra-args]
snprintf(tmpbuf,21,"%20lli",newval);
^~~~~~~~
gcc machine_type.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc main.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
main.c: In function 'main':
main.c:765:36: warning: unknown conversion type character 'l' in format [-Wformat=]
if (gosearch1) fprintf(stderr,"%lli occurances found in %s\n",search1.occurancesfound,buf1->filename);
^
main.c:765:60: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'tInt64' {aka 'long long int'} [-Wformat=]
if (gosearch1) fprintf(stderr,"%lli occurances found in %s\n",search1.occurancesfound,buf1->filename);
~^ ~~~~~~~~~~~~~~~~~~~~~~~
%I64d
main.c:765:33: warning: too many arguments for format [-Wformat-extra-args]
if (gosearch1) fprintf(stderr,"%lli occurances found in %s\n",search1.occurancesfound,buf1->filename);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:766:36: warning: unknown conversion type character 'l' in format [-Wformat=]
if (gosearch2) fprintf(stderr,"%lli occurances found in %s\n",search2.occurancesfound,buf2->filename);
^
main.c:766:60: warning: format '%s' expects argument of type 'char *', but argument 3 has type 'tInt64' {aka 'long long int'} [-Wformat=]
if (gosearch2) fprintf(stderr,"%lli occurances found in %s\n",search2.occurancesfound,buf2->filename);
~^ ~~~~~~~~~~~~~~~~~~~~~~~
%I64d
main.c:766:33: warning: too many arguments for format [-Wformat-extra-args]
if (gosearch2) fprintf(stderr,"%lli occurances found in %s\n",search2.occurancesfound,buf2->filename);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc markers.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
markers.c: In function 'writemarkerfile':
markers.c:94:21: warning: unknown conversion type character 'l' in format [-Wformat=]
fprintf(f,"%c%016llX\n",markers->relative[i],markers->cursorpos[i]);
^
markers.c:94:13: warning: too many arguments for format [-Wformat-extra-args]
fprintf(f,"%c%016llX\n",markers->relative[i],markers->cursorpos[i]);
^~~~~~~~~~~~~
markers.c: In function 'gotomask':
markers.c:170:25: warning: unknown conversion type character 'l' in format [-Wformat=]
snprintf(buf,17,"%c%llx",markers->relative[i],markers->cursorpos[i]);
^
markers.c:170:20: warning: too many arguments for format [-Wformat-extra-args]
snprintf(buf,17,"%c%llx",markers->relative[i],markers->cursorpos[i]);
^~~~~~~~
gcc menu.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc output.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc search.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
search.c: In function 'searchfor':
search.c:128:52: warning: unknown conversion type character 'l' in format [-Wformat=]
if (search->writesearchlog) fprintf(fwlog,"%016llx\n",(tUInt64)actcursorpos+buf->baseaddr); else done=1;
^
search.c:128:46: warning: too many arguments for format [-Wformat-extra-args]
if (search->writesearchlog) fprintf(fwlog,"%016llx\n",(tUInt64)actcursorpos+buf->baseaddr); else done=1;
^~~~~~~~~~~
gcc ui.c -c -I. -I/usr/include -I/usr/local/include -I/usr/include/ncurses -I/usr/local/include/ncurses -O3 -Wall
gcc -L/usr/lib -L/usr/local/lib -L/usr/lib/ncurses -L/usr/local/lib/ncurses -o dhex buffers.o configfile.o correlation.o gpl.o hexcalc.o input.o machine_type.o main.o markers.o menu.o output.o search.o ui.o -lncurses
correlation.o:correlation.c:(.rdata$.refptr._impure_ptr[.refptr._impure_ptr]+0x0): undefined reference to `_impure_ptr'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:27: dhex] Error 1
Would anyone know what I need to do, in order to have dhex compiled under MINGW64 (so it does not depend on MSYS dlls anymore)?
I downloaded the package in question and figured out how to compile it with the MinGW-w64 64-bit toolchain provided by MSYS2.
First of all, install the relevant development tools and libraries:
pacman -S base-devel mingw-w64-x86_64-{ncurses,toolchain}
Next, you need to edit the Makefile that comes with the package. The LDFLAGS, CPPFLAGS, and CFLAGS values must be modified to the following:
LDFLAGS=
CPPFLAGS= -I$(MINGW_PREFIX)/include/ncurses
CFLAGS= -D__USE_MINGW_ANSI_STDIO=1 -O3 -Wall
Some explanation: It is very bad that the Makefile has hardcoded paths in LDFLAGS and CPPFLAGS, because if you were to use those paths then you would be using files from another toolchain (the msys-2.0.dll-based one). So we need to get to get rid of those. Also, to get rid of all the warnings about printf formatting, we must supply the -D__USE_MINGW_ANSI_STDIO argument.
Then, just run make.
My GNU scientific library (http://www.gnu.org/software/gsl/) installed in the path: /home/myname/gsl-1.6
My mlRho 1.7-stat prog (http://guanine.evolbio.mpg.de/mlRho/mlRho_1.7.tgz) which uses GNU scientific library-installed in:/home/myname/MlRho_1.7
my operating system: Fedora 16
original make file in mlRho
cd /home/myname/MlRho_1.7/
vim make
CC=gcc
CFLAGS= -O3 -Wall -Wshadow -pedantic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVER32 \
-I/opt/local/include/ -L/opt/local/lib/
I have changed path in mlRho
CC=gcc
CFLAGS= -O3 -Wall -Wshadow -pedantic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVER32 \
-I/home/myname/gsl-1.6 -L/home/myname/gsl-1.6
after making changes, I tried running make, it gives error
make
gcc -O3 -Wall -Wshadow -pedantic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVER32 -I/home/myname/gsl-1.6/include/ -L/home/myname/gsl-1.6/lib/ -c -o mlRho.o mlRho.c
In file included from mlRho.c:16:0:
mlComp.h:7:30: fatal error: gsl/gsl_sf_gamma.h: No such file or directory
compilation terminated.
make: *** [mlRho.o] Error 1
when i do make test- it gives me error below
make test
make[1]: Entering directory `/home/myname/MlRho_1.7/TestMlPi'
gcc -O3 -Wall -Wshadow -pedantic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVER32 -I/opt/local/include/ -L/opt/local/lib/ -c -o testMlPi.o testMlPi.c
testMlPi.c: In function ‘main’:
testMlPi.c:62:67: warning: variable ‘sderr’ set but not used [-Wunused-but-set-variable]
testMlPi.c:62:60: warning: variable ‘sdhet’ set but not used [-Wunused-but-set-variable]
gcc -O3 -Wall -Wshadow -pedantic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVER32 -I/opt/local/include/ -L/opt/local/lib/ -c -o interface.o interface.c
gcc -O3 -Wall -Wshadow -pedantic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVER32 -I/opt/local/include/ -L/opt/local/lib/ -c -o eprintf.o eprintf.c
gcc -O3 -Wall -Wshadow -pedantic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVER32 -I/opt/local/include/ -L/opt/local/lib/ -c -o ranNum.o ranNum.c
gcc -O3 -Wall -Wshadow -pedantic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVER32 -I/opt/local/include/ -L/opt/local/lib/ -o testMlPi testMlPi.o interface.o eprintf.o ranNum.o -lm
make[1]: Leaving directory `/home/myname/MlRho_1.7/TestMlPi'
Output from testMlPi:
pi: 5.00e-05 epsilon: 4.90e-04 -log(L): 1.40e+05
Output from mlRho:
make: ./mlRho: Command not found
make: *** [testPi] Error 127
Output from mlRho:
make: ./mlRho: Command not found
make: *** [testPi] Error 127
It somehow GNU library not linking to mlRho programme. How to fix it?
We are a team working on an R package containing C/C++ code. The package can successfully be installed on all the machines but one. These all run the same version of Mac OS X. I have provided the log files for the installation of the package on my computer (success) and a colleague's computer (error). The package depends on the Rcpp package and the GSL library, both of which were successfully installed on both machines.
My Computer
WARNING: ignoring environment value of R_HOME
* installing to library '/Users/dejayn/R/x86_64-apple-darwin10.8.0-library/2.15'
* installing *source* package 'mrenci' ...
** libs
*** arch - x86_64
/opt/local/bin/g++-mp-4.5 -I/opt/local/lib/R/include -I/opt/local/lib/R/include/x86_64 -DNDEBUG -fopenmp -fopenmp -I/opt/local/include -I"/Users/dejayn/R/x86_64-apple-darwin10.8.0-library/2.15/Rcpp/include" -fPIC -pipe -O2 -m64 -c MRMRTree.cc -o MRMRTree.o
/opt/local/bin/g++-mp-4.5 -I/opt/local/lib/R/include -I/opt/local/lib/R/include/x86_64 -DNDEBUG -fopenmp -fopenmp -I/opt/local/include -I"/Users/dejayn/R/x86_64-apple-darwin10.8.0-library/2.15/Rcpp/include" -fPIC -pipe -O2 -m64 -c Matrix.cc -o Matrix.o
/opt/local/bin/g++-mp-4.5 -I/opt/local/lib/R/include -I/opt/local/lib/R/include/x86_64 -DNDEBUG -fopenmp -fopenmp -I/opt/local/include -I"/Users/dejayn/R/x86_64-apple-darwin10.8.0-library/2.15/Rcpp/include" -fPIC -pipe -O2 -m64 -c MiMBuilder.cc -o MiMBuilder.o
/opt/local/bin/g++-mp-4.5 -I/opt/local/lib/R/include -I/opt/local/lib/R/include/x86_64 -DNDEBUG -fopenmp -fopenmp -I/opt/local/include -I"/Users/dejayn/R/x86_64-apple-darwin10.8.0-library/2.15/Rcpp/include" -fPIC -pipe -O2 -m64 -c SymmetricMatrix.cc -o SymmetricMatrix.o
/opt/local/bin/g++-mp-4.5 -I/opt/local/lib/R/include -I/opt/local/lib/R/include/x86_64 -DNDEBUG -fopenmp -fopenmp -I/opt/local/include -I"/Users/dejayn/R/x86_64-apple-darwin10.8.0-library/2.15/Rcpp/include" -fPIC -pipe -O2 -m64 -c adaptor.cc -o adaptor.o
/opt/local/bin/g++-mp-4.5 -I/opt/local/lib/R/include -I/opt/local/lib/R/include/x86_64 -DNDEBUG -fopenmp -fopenmp -I/opt/local/include -I"/Users/dejayn/R/x86_64-apple-darwin10.8.0-library/2.15/Rcpp/include" -fPIC -pipe -O2 -m64 -c memory.cc -o memory.o
/opt/local/bin/g++-mp-4.5 -I/opt/local/lib/R/include -I/opt/local/lib/R/include/x86_64 -DNDEBUG -fopenmp -fopenmp -I/opt/local/include -I"/Users/dejayn/R/x86_64-apple-darwin10.8.0-library/2.15/Rcpp/include" -fPIC -pipe -O2 -m64 -c tools.cc -o tools.o
/opt/local/bin/g++-mp-4.5 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/opt/local/lib -o mrenci.so MRMRTree.o Matrix.o MiMBuilder.o SymmetricMatrix.o adaptor.o memory.o tools.o /Users/dejayn/R/x86_64-apple-darwin10.8.0-library/2.15/Rcpp/lib/x86_64/libRcpp.a -fopenmp -fopenmp -L/opt/local/lib/R/lib/x86_64 -lR
installing to /Users/dejayn/R/x86_64-apple-darwin10.8.0-library/2.15/mrenci/libs/x86_64
** R
** preparing package for lazy loading
** testing if installed package can be loaded
* DONE (mrenci)
Colleague's Computer
WARNING: ignoring environment value of R_HOME
* installing to library '/Library/Frameworks/R.framework/Versions/2.15/Resources/library'
* installing *source* package 'mrenci' ...
** libs
*** arch - x86_64
g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -fopenmp -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -g -O2 -c MRMRTree.cc -o MRMRTree.o
MRMRTree.cc: In member function 'double* const MRMRTree::bootstrap(unsigned int)':
MRMRTree.cc:73: warning: iteration variable 'i' is unsigned
g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -fopenmp -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -g -O2 -c Matrix.cc -o Matrix.o
g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -fopenmp -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -g -O2 -c MiMBuilder.cc -o MiMBuilder.o
MiMBuilder.cc: In member function 'Matrix* const MiMBuilder::createMiM(unsigned int*, unsigned int, unsigned int*, unsigned int)':
MiMBuilder.cc:102: warning: iteration variable 'i' is unsigned
g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -fopenmp -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -g -O2 -c SymmetricMatrix.cc -o SymmetricMatrix.o
g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -fopenmp -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -g -O2 -c adaptor.cc -o adaptor.o
g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -fopenmp -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -g -O2 -c memory.cc -o memory.o
g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG -fopenmp -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include" -fPIC -g -O2 -c tools.cc -o tools.o
g++ -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -o mrenci.so MRMRTree.o Matrix.o MiMBuilder.o SymmetricMatrix.o adaptor.o memory.o tools.o /Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/lib/x86_64/libRcpp.a -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/2.15/Resources/library/mrenci/libs/x86_64
** R
** preparing package for lazy loading
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/Library/Frameworks/R.framework/Versions/2.15/Resources/library/mrenci/libs/x86_64/mrenci.so':
dlopen(/Library/Frameworks/R.framework/Versions/2.15/Resources/library/mrenci/libs/x86_64/mrenci.so, 6): Symbol not found: _GOMP_critical_name_end
Referenced from: /Library/Frameworks/R.framework/Versions/2.15/Resources/library/mrenci/libs/x86_64/mrenci.so
Expected in: flat namespace
in /Library/Frameworks/R.framework/Versions/2.15/Resources/library/mrenci/libs/x86_64/mrenci.so
Error: loading failed
Execution halted
ERROR: loading failed
* removing '/Library/Frameworks/R.framework/Versions/2.15/Resources/library/mrenci'
At first, the installation on my colleague's computer would result in the compilation of the package for both architectures, upon which g++ complained about an unknown -arch argument. This issue, however, appears to have been mitigated by forcing the targeting of a single architecture x86_64. It is also worth noting that as a result of these errors, all computers now have several versions of R and g++. Is this an issue with the linker? Does the same compiler need to be used for both R and its packages? In the case of my computer, I never explicitly asked for g++-mp-4.5 to be used rather than the default g++ (version 4.2), so I figured R automatically detects it.
In case this is of any help, here is what my Makevars contains:
PKG_LIBS=`$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"` $(SHLIB_OPENMP_CFLAGS) -fopenmp
PKG_CPPFLAGS=$(SHLIB_OPENMP_CXXFLAGS) -fopenmp
PKG_CFLAGS=$(SHLIB_OPENMP_CFLAGS) -fopenmp
The $(SHLIB_OPENMP_*FLAGS) flags seem to be defined only on my computer; -fopenmp flags were explicitly added for the package to work on all the machines.
Has anyone experienced similar issues? Any help would be appreciated.
I changed my colleague's ~/.R/Makevars to conform to my configs
LDFLAGS=-L/opt/local/lib
CC=/opt/local/bin/gcc-mp-4.5 -std=gnu99
CXX=/opt/local/bin/g++-mp-4.5
CPP=/opt/local/bin/gcc-mp-4.5 -std=gnu99 -E
CXXCPP=/opt/local/bin/g++-mp-4.5 -E
CFLAGS=-pipe -O2 -m64
CXXFLAGS=-pipe -O2 -m64
SHLIB_CXXLD=/opt/local/bin/g++-mp-4.5
SHLIB_CXXLDFLAGS=-dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress
SHLIB_LD=/opt/local/bin/gcc-mp-4.5 -std=gnu99
SHLIB_LDFLAGS=-dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress
Additionally, the --no-multiarch argument was used when issuing the installation command. And it now works on his computer.
The problem was because the use of openMP was hardwired (no checks) inside the code and clang did not support openMP at the same I asked the question. My colleague's R was installed using the default (Xcode) compiler when we were trying to use gcc via Mac Ports.