physionet
physionet copied to clipboard
Erro ao Compilar no MSys2
Hello, thank you for sharing your work with the community.
I'm trying to compile WFDB in Msys2, I'm using GCC 6.2.0 as below:
consu_000@Estudio-2 MSYS ~/wfdb-10.5.24
$ gcc --version
gcc.exe (Rev2, Built by MSYS2 project) 6.2.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
While running configure it looks fine, but make not:
...
...
gcc -shared -Wl,-soname, -o wfdbinit.o annot.o signal.o calib.o wfdbio.o `curl-config --libs`
signal.o: In function `edfparse':
C:\msys64\home\consu_000\wfdb-10.5.24\lib/signal.c:765: undefined reference to `getafreq'
C:\msys64\home\consu_000\wfdb-10.5.24\lib/signal.c:765: undefined reference to `setafreq'
signal.o: In function `setifreq':
C:\msys64\home\consu_000\wfdb-10.5.24\lib/signal.c:2396: undefined reference to `setafreq'
collect2.exe: error: ld returned 1 exit status
make[3]: *** [Makefile:252: all] Error 1
make[3]: Leaving directory '/home/consu_000/wfdb-10.5.24/lib'
make[2]: *** [Makefile:257: install] Error 2
make[2]: Leaving directory '/home/consu_000/wfdb-10.5.24/lib'
make[1]: *** [Makefile:312: install] Error 2
make[1]: Leaving directory '/home/consu_000/wfdb-10.5.24'
make: *** [Makefile:308: all] Error 2
I have CURL and LIBCURL and LibExpad installed, and the path is as below:
consu_000@Estudio-2 MSYS ~/wfdb-10.5.24
$ pacman -Ss curl
mingw32/mingw-w64-i686-curl 7.51.0-1
An URL retrival utility and library. (mingw-w64)
mingw32/mingw-w64-i686-flickcurl 1.26-1
Flickcurl is a C library for the Flickr API (mingw-w64)
mingw64/mingw-w64-x86_64-curl 7.51.0-1 [instalado]
An URL retrival utility and library. (mingw-w64)
mingw64/mingw-w64-x86_64-flickcurl 1.26-1
Flickcurl is a C library for the Flickr API (mingw-w64)
msys/curl 7.51.0-1 (base) [instalado]
Multi-protocol file transfer utility
msys/libcurl 7.51.0-1 (libraries) [instalado]
Multi-protocol file transfer library (runtime)
msys/libcurl-devel 7.51.0-1 (development) [instalado]
Libcurl headers and libraries
consu_000@Estudio-2 MSYS ~/wfdb-10.5.24
$ pacman -Ss libexpat
msys/libexpat 2.2.0-1 (libraries) [instalado]
An XML parser library
msys/libexpat-devel 2.2.0-1 (development) [instalado]
Libexpat headers and libraries
Is there anything else that should be done? What could be missing?
Below are all commands and their outputs:
consu_000@Estudio-2 MSYS ~
$ export PATH=/mingw64/bin:$PATH
consu_000@Estudio-2 MSYS ~
$ cd wfdb-10.5.24/
cconsu_000@Estudio-2 MSYS ~/wfdb-10.5.24
$ ./configure --prefix=/mingw64 --without-cygwin
Checking the operating system type ...
Configuring the WFDB software package for generic.
Checking the echo command ...
Using the generic configuration, which may need to be customized
for your operating system. 'configure' will offer suggestions
for customization after it completes the generic configuration.
Looking for the C compiler ... gcc
The WFDB software will be installed in '/mingw64'.
The manual pages will be installed in '/mingw64/man'.
Looking for libcurl ... found
The WFDB software will be compiled with NETFILES access
using libcurl.
Creating Makefile in lib ...
Creating Makefile in app ...
Creating Makefile in checkpkg ...
Creating Makefile in convert ...
Creating Makefile in data ...
Creating Makefile in doc ...
Creating Makefile in doc/wag-src ...
Creating Makefile in doc/wpg-src ...
Creating Makefile in doc/wug-src ...
Creating Makefile in examples ...
Creating Makefile in fortran ...
Creating Makefile in psd ...
Creating Makefile in wave ...
Creating Makefile in waverc ...
Creating Makefile in xml ...
Creating Makefile in . ...
rm conf/site.def conf/site-slib.def
Looking for the XView libraries ... not found
WAVE will not be compiled, because the XView libraries do not
appear to be installed on this system.
To compile WAVE, install XView, add the directory containing the
XView textedit application to your PATH, and run ./configure again.
IMPORTANT: You have chosen to build a dynamic (shared) WFDB library in
a directory, /mingw64/lib, that is not normally searched for such
libraries. In order to use the applications that will be compiled
with this library, it may be necessary to add this directory to your
LD_LIBRARY_PATH. If your shell is csh or a variant, do this by
typing:
setenv LD_LIBRARY_PATH /mingw64/lib
Otherwise, do this by typing:
LD_LIBRARY_PATH=/mingw64/lib
export LD_LIBRARY_PATH
No specific configuration information is available for your operating
system. Please try compiling using the generic Makefiles that have
been generated by this configuration utility. If there are problems,
it may be possible to solve them by customizing conf/generic.def (and
conf/generic-slib.def if you are attempting to compile a shared WFDB
library). Run ./configure again after making any necessary changes to
these files. Please send reports of success or failure, together with
the output of the command 'uname -a', and copies of any files you have
changed, to:
[email protected]
Summary:
wfdb-10.5.24-generic is now ready to be compiled using 'gcc'.
The WFDB library will be compiled as a dynamic library with NETFILES
access via libcurl, and it will be installed in '/mingw64/lib'.
The WFDB library .h files will be installed in '/mingw64/include/wfdb'.
The WFDB applications will be linked to dynamic system libraries, and
they will be installed in '/mingw64/bin'.
WAVE will not be compiled.
Manual pages will be installed in subdirectories of '/mingw64/man'.
Sample data files will be installed in '/mingw64/database', which
will be included in the default WFDB path.
If you need to compile a different WFDB library type, or install into different
directories, rerun this script with its "-i" (interactive) option:
./configure -i
Other options can be viewed by rerunning this script with its "-h" option:
./configure -h
WFDB software configuration is complete.
Now run 'make' to compile and test, followed by 'make install' to recompile
and install the software, man pages, and example data. Finally, run
'make check' to verify that the installation is complete and successful.
consu_000@Estudio-2 MSYS ~/wfdb-10.5.24
$ make
make WFDBROOT=`pwd`/build LIBDIR=`pwd`/build/lib install check
make[1]: Entering directory '/home/consu_000/wfdb-10.5.24'
cd lib; make clean install
make[2]: Entering directory '/home/consu_000/wfdb-10.5.24/lib'
rm -f wfdbinit.o annot.o signal.o calib.o wfdbio.o libwfdb.* *.dll *~
make clean # force recompilation since config may have changed
make[3]: Entering directory '/home/consu_000/wfdb-10.5.24/lib'
rm -f wfdbinit.o annot.o signal.o calib.o wfdbio.o libwfdb.* *.dll *~
make[3]: Leaving directory '/home/consu_000/wfdb-10.5.24/lib'
make all
make[3]: Entering directory '/home/consu_000/wfdb-10.5.24/lib'
sed "s+DBDIR+/home/consu_000/wfdb-10.5.24/build/database+" <wfdblib.h0 >wfdblib.h
gcc -fpic -g -O -DWFDB_MAJOR=10 -DWFDB_MINOR=5 -DWFDB_RELEASE=24 `curl-config --cflags` -I/home/consu_000/wfdb-10.5.24/build/include -c -o wfdbinit.o wfdbinit.c
gcc -fpic -g -O -DWFDB_MAJOR=10 -DWFDB_MINOR=5 -DWFDB_RELEASE=24 `curl-config --cflags` -I/home/consu_000/wfdb-10.5.24/build/include -c -o annot.o annot.c
In file included from wfdblib.h:34:0,
from annot.c:95:
annot.c: In function 'get_ann_table':
wfdb.h:208:11: warning: implicit declaration of function 'wfdb_me_fatal' [-Wimplicit-function-declaration]
if (wfdb_me_fatal()) exit(1); }
^
wfdb.h:210:57: note: in expansion of macro 'MEMERR'
#define SUALLOC(P, N, S) { if (!(P = calloc((N), (S)))) MEMERR(P, (N), (S)); }
^~~~~~
wfdb.h:211:37: note: in expansion of macro 'SUALLOC'
#define SALLOC(P, N, S) { SFREE(P); SUALLOC(P, (N), (S)) }
^~~~~~~
wfdb.h:214:3: note: in expansion of macro 'SALLOC'
SALLOC(P, (size_t)strlen(Q)+1,1); strcpy(P, Q); } }
^~~~~~
annot.c:188:6: note: in expansion of macro 'SSTRCPY'
SSTRCPY(s1, p1);
^~~~~~~
gcc -fpic -g -O -DWFDB_MAJOR=10 -DWFDB_MINOR=5 -DWFDB_RELEASE=24 `curl-config --cflags` -I/home/consu_000/wfdb-10.5.24/build/include -c -o signal.o signal.c
In file included from wfdblib.h:34:0,
from signal.c:175:
signal.c: In function 'allocisig':
wfdb.h:208:11: warning: implicit declaration of function 'wfdb_me_fatal' [-Wimplicit-function-declaration]
if (wfdb_me_fatal()) exit(1); }
^
wfdb.h:212:61: note: in expansion of macro 'MEMERR'
#define SREALLOC(P, N, S) { if (!(P = realloc(P, (N)*(S)))) MEMERR(P,(N),(S)); }
^~~~~~
signal.c:342:2: note: in expansion of macro 'SREALLOC'
SREALLOC(isd, n, sizeof(struct isdata *));
^~~~~~~~
gcc -fpic -g -O -DWFDB_MAJOR=10 -DWFDB_MINOR=5 -DWFDB_RELEASE=24 `curl-config --cflags` -I/home/consu_000/wfdb-10.5.24/build/include -c -o calib.o calib.c
In file included from wfdblib.h:34:0,
from calib.c:49:
calib.c: In function 'calopen':
wfdb.h:208:11: warning: implicit declaration of function 'wfdb_me_fatal' [-Wimplicit-function-declaration]
if (wfdb_me_fatal()) exit(1); }
^
wfdb.h:210:57: note: in expansion of macro 'MEMERR'
#define SUALLOC(P, N, S) { if (!(P = calloc((N), (S)))) MEMERR(P, (N), (S)); }
^~~~~~
calib.c:108:2: note: in expansion of macro 'SUALLOC'
SUALLOC(this_cle, 1, (sizeof(struct cle)));
^~~~~~~
gcc -fpic -g -O -DWFDB_MAJOR=10 -DWFDB_MINOR=5 -DWFDB_RELEASE=24 `curl-config --cflags` -I/home/consu_000/wfdb-10.5.24/build/include -DVERSION='"10.5.24"' -DCFLAGS='"-I/home/consu_000/wfdb-10.5.24/build/include"' \
-DLDFLAGS='"-L/home/consu_000/wfdb-10.5.24/build/lib -lwfdb -Wl,-rpath -Wl,/home/consu_000/wfdb-10.5.24/build/lib `curl-config --libs`"' -c wfdbio.c
In file included from wfdblib.h:34:0,
from wfdbio.c:156:
wfdbio.c: In function 'resetwfdb':
wfdb.h:208:11: warning: implicit declaration of function 'wfdb_me_fatal' [-Wimplicit-function-declaration]
if (wfdb_me_fatal()) exit(1); }
^
wfdb.h:210:57: note: in expansion of macro 'MEMERR'
#define SUALLOC(P, N, S) { if (!(P = calloc((N), (S)))) MEMERR(P, (N), (S)); }
^~~~~~
wfdb.h:211:37: note: in expansion of macro 'SUALLOC'
#define SALLOC(P, N, S) { SFREE(P); SUALLOC(P, (N), (S)) }
^~~~~~~
wfdb.h:214:3: note: in expansion of macro 'SALLOC'
SALLOC(P, (size_t)strlen(Q)+1,1); strcpy(P, Q); } }
^~~~~~
wfdbio.c:178:5: note: in expansion of macro 'SSTRCPY'
SSTRCPY(wfdbpath, wfdbpath_init);
^~~~~~~
wfdbio.c: In function 'wfdb_parse_path':
wfdbio.c:464:12: warning: type defaults to 'int' in declaration of 'first_call' [-Wimplicit-int]
static first_call = 1;
^~~~~~~~~~
gcc -shared -Wl,-soname, -o wfdbinit.o annot.o signal.o calib.o wfdbio.o `curl-config --libs`
signal.o: In function `edfparse':
C:\msys64\home\consu_000\wfdb-10.5.24\lib/signal.c:765: undefined reference to `getafreq'
C:\msys64\home\consu_000\wfdb-10.5.24\lib/signal.c:765: undefined reference to `setafreq'
signal.o: In function `setifreq':
C:\msys64\home\consu_000\wfdb-10.5.24\lib/signal.c:2396: undefined reference to `setafreq'
collect2.exe: error: ld returned 1 exit status
make[3]: *** [Makefile:252: all] Error 1
make[3]: Leaving directory '/home/consu_000/wfdb-10.5.24/lib'
make[2]: *** [Makefile:257: install] Error 2
make[2]: Leaving directory '/home/consu_000/wfdb-10.5.24/lib'
make[1]: *** [Makefile:312: install] Error 2
make[1]: Leaving directory '/home/consu_000/wfdb-10.5.24'
make: *** [Makefile:308: all] Error 2
I just installed everything from scratch and I did manage to compile.
- Are you running all this via the msys shell with the mingw64 environment? ie. you are using the terminal that results by opening 'msys2.exe' located in
C:\msys64
- With cygwin/mingw, the WFDB libraries get installed in /usr/local/bin. When I ran
./configure --prefix=/usr/local
I get:
IMPORTANT: You have chosen to build a dynamic (shared) WFDB library in a directory, /usr/local/bin, that is not normally searched for such libraries. In order to use the applications that will be compiled with this library, it may be necessary to add this directory to your LD_LIBRARY_PATH.
... LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/bin export LD_LIBRARY_PATH
I assume you installed the base packages like gcc, tar, man, make, libexpat via the msys2.exe shell by using pacman, like I did. Can you try compiling with the msys2.exe shell and set the environment variable as above and tell me what you get?
During this week I will try again.
But I added that I used the bat that is in the MSys2 directory, anyway, because of disenchantment I will reinstall MSys2 from scratch so that there is no influence of other tests that I have done with new libraries.
Put until the second the result. Thank you.