Issue installing simuPOP's new patch due to zlib.h missing file
Closed this issue · 4 comments
Following up from issue #114, as requested:
Hi Bo,
I am running simuPOP on a virtual environment using Spyder (on Windows 10 OS).
I have faced this issue of a missing zlib.h file while installing simuPOP the first time around, but I cannot recall what I have done that time; I think I uninstalled VSCode and it worked from there, but I'm afraid of doing it again and losing the simuPOP version I have that does work on my pc.
The commands I used to install the new patch were (on Windows cmd):
activate simuPOP-env
winget install --id Git.Git -e --source winget
cd C:\Users\marin\anaconda3\envs\simuPOP-env\
git clone -b issue114 https://github.com/BoPeng/simuPOP.git
cd simuPOP
python setup.py install
Then, I get this error message:
(simuPOP-env) C:\Users\marin\anaconda3\envs\simuPOP-env\simuPOP>python setup.py install
test_compile.cpp
Testing tr1 support: yes
Testing c++ library: visual c++
Building static libraries
infnan.c
coerce.c
fdiv.c
pow_int.c
fcmp.c
log1p.c
invhyp.c
math.c
beta.c
psi.c
gsl/specfunc/psi.c(524): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
gsl/specfunc/psi.c(736): warning C4244: 'initializing': conversion from 'double' to 'int', possible loss of data
trig.c
gsl/specfunc/trig.c(184): warning C4244: 'initializing': conversion from 'double' to 'int', possible loss of data
gsl/specfunc/trig.c(256): warning C4244: 'initializing': conversion from 'double' to 'int', possible loss of data
exp.c
expint.c
log.c
erfc.c
zeta.c
gsl/specfunc/zeta.c(824): warning C4244: 'initializing': conversion from 'double' to 'const int', possible loss of data
elementary.c
gamma.c
gamma_inc.c
gsl/specfunc/gamma_inc.c(120): warning C4244: 'initializing': conversion from 'const double' to 'int', possible loss of data
borosh13.c
fishman2x.c
mt.c
rand.c
ranmar.c
types.c
cmrg.c
gfsr4.c
r250.c
random.c
rng.c
uni32.c
coveyou.c
knuthran2.c
ran0.c
randu.c
slatec.c
uni.c
default.c
knuthran.c
ran1.c
ranf.c
taus113.c
vax.c
file.c
lecuyer21.c
ran2.c
ranlux.c
taus.c
waterman14.c
fishman18.c
minstd.c
ran3.c
ranlxd.c
gsl/rng/ranlxd.c(152): warning C4244: 'return': conversion from 'double' to 'unsigned long', possible loss of data
transputer.c
zuf.c
fishman20.c
mrg.c
rand48.c
ranlxs.c
gsl/rng/ranlxs.c(202): warning C4244: 'return': conversion from 'double' to 'unsigned long', possible loss of data
tt.c
knuthran2002.c
binomial.c
binomial_tpe.c
beta.c
exponential.c
geometric.c
gsl/randist/geometric.c(45): warning C4244: '=': conversion from 'double' to 'unsigned int', possible loss of data
nbinomial.c
poisson.c
gsl/randist/poisson.c(41): warning C4244: 'initializing': conversion from 'double' to 'unsigned int', possible loss of data
multinomial.c
chisq.c
gauss.c
gausszig.c
gamma.c
gsl/randist/gamma.c(44): warning C4244: 'initializing': conversion from 'double' to 'unsigned int', possible loss of data
gammainv.c
binomial.c
beta.c
betainv.c
gauss.c
gaussinv.c
chisq.c
chisqinv.c
gamma.c
poisson.c
error.c
archive_exception.cpp
basic_archive.cpp
basic_iarchive.cpp
basic_iserializer.cpp
basic_oarchive.cpp
basic_oserializer.cpp
basic_pointer_iserializer.cpp
basic_pointer_oserializer.cpp
basic_serializer_map.cpp
basic_text_iprimitive.cpp
basic_text_oprimitive.cpp
basic_text_wiprimitive.cpp
basic_text_woprimitive.cpp
codecvt_null.cpp
extended_type_info.cpp
extended_type_info_no_rtti.cpp
extended_type_info_typeid.cpp
polymorphic_iarchive.cpp
polymorphic_oarchive.cpp
polymorphic_text_iarchive.cpp
polymorphic_text_oarchive.cpp
polymorphic_text_wiarchive.cpp
polymorphic_text_woarchive.cpp
stl_port.cpp
text_iarchive.cpp
text_oarchive.cpp
text_wiarchive.cpp
text_woarchive.cpp
utf8_codecvt_facet.cpp
void_cast.cpp
file_descriptor.cpp
gzip.cpp
mapped_file.cpp
zlib.cpp
boost_1_70_0\libs\iostreams\src\zlib.cpp(20): fatal error C1083: Cannot open include file: 'zlib.h': No such file or directory
I checked and I do have zlib installed:
(simuPOP-env) C:\Users\marin\anaconda3\envs\simuPOP-env\simuPOP>.\vcpkg\vcpkg install zlib
warning: In the September 2023 release, the default triplet for vcpkg libraries changed from x86-windows to the detected host triplet (x64-windows). For the old behavior, add --triplet x86-windows . To suppress this message, add --triplet x64-windows .
Computing installation plan...
The following packages are already installed:
zlib:x64-windows@1.3
zlib:x64-windows is already installed
Total install time: 381 us
The package zlib is compatible with built-in CMake targets:
find_package(ZLIB REQUIRED)
target_link_libraries(main PRIVATE ZLIB::ZLIB)
I am using:
OS Version: Windows 10.0.22621
Spyder Version: 5.5.0
simuPOP Version: 1.1.10.9
Python Version: 3.8.18 | packaged by conda-forge | (default, Oct 10 2023, 15:37:54) [MSC v.1929 64 bit (AMD64)]
Thank you again for your time and patience.
Would conda install -c anaconda zlib
help?
I have tried that earlier today and again now, and here's the very long output:
conda install -c anaconda zlib.txt, of note
The following specifications were found to be incompatible with a past
explicit spec that is not an explicit spec in this operation (zlib):
- zlib
I still then get the message
(simuPOP-env) C:\Users\marin\anaconda3\envs\simuPOP-env\simuPOP>python setup.py install
test_compile.cpp
Testing tr1 support: yes
Testing c++ library: visual c++
Building static libraries
infnan.c
coerce.c
fdiv.c
pow_int.c
fcmp.c
log1p.c
invhyp.c
math.c
beta.c
psi.c
gsl/specfunc/psi.c(524): warning C4244: '=': conversion from 'double' to 'int', possible loss of data
gsl/specfunc/psi.c(736): warning C4244: 'initializing': conversion from 'double' to 'int', possible loss of data
trig.c
gsl/specfunc/trig.c(184): warning C4244: 'initializing': conversion from 'double' to 'int', possible loss of data
gsl/specfunc/trig.c(256): warning C4244: 'initializing': conversion from 'double' to 'int', possible loss of data
exp.c
expint.c
log.c
erfc.c
zeta.c
gsl/specfunc/zeta.c(824): warning C4244: 'initializing': conversion from 'double' to 'const int', possible loss of data
elementary.c
gamma.c
gamma_inc.c
gsl/specfunc/gamma_inc.c(120): warning C4244: 'initializing': conversion from 'const double' to 'int', possible loss of data
borosh13.c
fishman2x.c
mt.c
rand.c
ranmar.c
types.c
cmrg.c
gfsr4.c
r250.c
random.c
rng.c
uni32.c
coveyou.c
knuthran2.c
ran0.c
randu.c
slatec.c
uni.c
default.c
knuthran.c
ran1.c
ranf.c
taus113.c
vax.c
file.c
lecuyer21.c
ran2.c
ranlux.c
taus.c
waterman14.c
fishman18.c
minstd.c
ran3.c
ranlxd.c
gsl/rng/ranlxd.c(152): warning C4244: 'return': conversion from 'double' to 'unsigned long', possible loss of data
transputer.c
zuf.c
fishman20.c
mrg.c
rand48.c
ranlxs.c
gsl/rng/ranlxs.c(202): warning C4244: 'return': conversion from 'double' to 'unsigned long', possible loss of data
tt.c
knuthran2002.c
binomial.c
binomial_tpe.c
beta.c
exponential.c
geometric.c
gsl/randist/geometric.c(45): warning C4244: '=': conversion from 'double' to 'unsigned int', possible loss of data
nbinomial.c
poisson.c
gsl/randist/poisson.c(41): warning C4244: 'initializing': conversion from 'double' to 'unsigned int', possible loss of data
multinomial.c
chisq.c
gauss.c
gausszig.c
gamma.c
gsl/randist/gamma.c(44): warning C4244: 'initializing': conversion from 'double' to 'unsigned int', possible loss of data
gammainv.c
binomial.c
beta.c
betainv.c
gauss.c
gaussinv.c
chisq.c
chisqinv.c
gamma.c
poisson.c
error.c
archive_exception.cpp
basic_archive.cpp
basic_iarchive.cpp
basic_iserializer.cpp
basic_oarchive.cpp
basic_oserializer.cpp
basic_pointer_iserializer.cpp
basic_pointer_oserializer.cpp
basic_serializer_map.cpp
basic_text_iprimitive.cpp
basic_text_oprimitive.cpp
basic_text_wiprimitive.cpp
basic_text_woprimitive.cpp
codecvt_null.cpp
extended_type_info.cpp
extended_type_info_no_rtti.cpp
extended_type_info_typeid.cpp
polymorphic_iarchive.cpp
polymorphic_oarchive.cpp
polymorphic_text_iarchive.cpp
polymorphic_text_oarchive.cpp
polymorphic_text_wiarchive.cpp
polymorphic_text_woarchive.cpp
stl_port.cpp
text_iarchive.cpp
text_oarchive.cpp
text_wiarchive.cpp
text_woarchive.cpp
utf8_codecvt_facet.cpp
void_cast.cpp
file_descriptor.cpp
gzip.cpp
mapped_file.cpp
zlib.cpp
boost_1_70_0\libs\iostreams\src\zlib.cpp(20): fatal error C1083: Cannot open include file: 'zlib.h': No such file or directory
I suggest that you compile simuPOP on a mac or linux system because it has been quite some time since I last used a windows system and have forgotten how to get MS Visual Studio work. As far as I remember I did not use conda at the time but conda may provide an easier way to install a C++ compiler. The INSTALL
instructions on the old sf.net site has vanished.
I have tagged this ticket with a help needed
tag. For anyone who figures out how to compile simuPOP under windows, please update the INSTALL
file and submit a PR. Thanks!
According to the conda-forge recipe, the conda-forge build environment needs to have zlib
installed. Since zlib is provided by conda-forge (https://anaconda.org/conda-forge/zlib), this should not be too difficult.