mm2 / Little-CMS

A free, open source, CMM engine. It provides fast transforms between ICC profiles.
https://www.littlecms.com
MIT License
572 stars 177 forks source link

error only building static version on MSYS2/MINGW64 #283

Closed gaaned92 closed 3 years ago

gaaned92 commented 3 years ago

Environment : W10, msys2/mingw64 updated to last version LCMS2 version : master 2.12-46-gc6d1c9c build procedure:

./configure --prefix=$destination --with-threads 
make
make install

When building above LCMS2 version, I get this error message:

/bin/sh ../libtool  --tag=CC   --mode=link gcc  -mtune=generic -O3 -fvisibility=hidden  -no-undefined -version-info 2:12:0  -o liblcms2.la -rpath /d/programmes/lcms2source/generic/lib cmscnvrt.lo cmserr.lo cmsgamma.lo cmsgmt.lo cmsintrp.lo cmsio0.lo cmsio1.lo cmslut.lo cmsplugin.lo cmssm.lo cmsmd5.lo cmsmtrx.lo cmspack.lo cmspcs.lo cmswtpnt.lo cmsxform.lo cmssamp.lo cmsnamed.lo cmscam02.lo cmsvirt.lo cmstypes.lo cmscgats.lo cmsps2.lo cmsopt.lo cmshalf.lo cmsalpha.lo -lm -lpthread

*** Warning: linker path does not have real file for library -lpthread.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libpthread and none of the candidates passed a file format test
*** using a file magic. Last file checked: C:/msys64/mingw64/x86_64-w64-mingw32/lib/libpthread.dll.a
*** The inter-library dependencies that have been dropped here will be
*** automatically added whenever a program is linked with this library
*** or is declared to -dlopen it.

*** Since this library must not contain undefined symbols,
*** because either the platform does not support them or
*** it was explicitly requested with -no-undefined,
*** libtool will only create a static version of it.
libtool: link: ar cru .libs/liblcms2.a  cmscnvrt.o cmserr.o cmsgamma.o cmsgmt.o cmsintrp.o cmsio0.o cmsio1.o cmslut.o cmsplugin.o cmssm.o cmsmd5.o cmsmtrx.o cmspack.o cmspcs.o cmswtpnt.o cmsxform.o cmssamp.o cmsnamed.o cmscam02.o cmsvirt.o cmstypes.o cmscgats.o cmsps2.o cmsopt.o cmshalf.o cmsalpha.o

last working version is d677b13

mm2 commented 3 years ago

It seems you are forcing pthread (using --with-threads) but you have not the library installed. Try to let configure to do its job of auto-detection:

./configure --prefix=$destination ; make ; sudo make install

That should do the trick. Another option on windows is to use visual studio.

gaaned92 commented 3 years ago

I verified that the library is installed and moreover, in same configuration, I can build commit d677b13. After that, certainly something was badly modified in the configure file.

mm2 commented 3 years ago

Reopened for inspection. Thanks for reporting.

mm2 commented 3 years ago

Sorry, I can't reproduce the issue. I have download & installed MINGW64, following https://www.msys2.org/ Then I installed pthreads https://packages.msys2.org/package/mingw-w64-x86_64-winpthreads Then I used the zipped head https://github.com/mm2/Little-CMS/archive/refs/heads/master.zip unpack and then ./configure --with-threads make make check All works fine for me. Checked 2.12 official and also works fine.

gaaned92 commented 3 years ago

Thanks for the verification. So certainly a problem in my installation. I will try to reinstall pthreads from scratch and use the zipped head and will report.

mm2 commented 3 years ago

Great. Please let me know, I will keep the issue open until I got your feedback.

gaaned92 commented 3 years ago

I reinstalled pthreads .

2.12 builds ok with flag --with-threads 2.12-46 cannot be built with above flag, but it builds without this flag.

The two versions have different configure files, but due to lack of understanding the commands, I cannot identify the reason of the problem.

I have two possibilities:

I am going to use second option. Thanks

mm2 commented 3 years ago

Cannot reproduce. closing it