Why can't QuantLib compile on its last release? - python-3.x

After following the QuantLib 1.9 installation tutorial, I can't compile the library on my computer.
my setup
tutorial : https://www.quantlib.org/install/windows-python.shtml
python 3.6.3
Quantlib 1.9
Quantlib-SWIG 1.9
boost boost_1_66_0
visual studio 2017
windows 10
My error is the following :
"running build
running build_py
running build_ext
building 'QuantLib._QuantLib' extension
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -D__WIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNOMINMAX (.....) IC:\Users\AppData\Local\Continuum\anaconda3\Lib\site-packages\boost_1_66_0 /EHsc /TpQuantLib/quantlib_wrap.cpp /Fobuild\temp.win-amd64-3.6\Release\QuantLib/quantlib_wrap.obj /GR /FD /Zm250 /EHsc /bigobj /MD
quantlib_wrap.cpp
Info: Boost.Config is older than your compiler version - probably nothing bad will happen - but you may wish to look for an update Boost version. Define BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE to suppress this message.
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO (....)/OUT:build\lib.win-amd64-3.6\QuantLib_QuantLib.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\QuantLib_QuantLib.cp36-win_amd64.lib /subsystem:windows /machine:x64
LINK : fatal error LNK1104: impossible d'ouvrir le fichier 'QuantLib-vc141-x64-mt.lib'
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\link.exe' failed with exit status 1104"
Wish someone could help with this one.

Related

Error when installing fbprophet on windows 10 using pip

I try to install "fbprophet" on Windows 10, using the following command:
pip install fbprophet
But I get the following error:
error: Command "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DBOOST_DISABLE_ASSERTS -DBOOST_NO_DECLTYPE -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_RESULT_OF_USE_TR1 -DFUSION_MAX_VECTOR_SIZE=12 -I.\pystan -Ipystan/stan/src -Ipystan/stan/lib/stan_math/ -Ipystan/stan/lib/stan_math/lib/eigen_3.3.3 -Ipystan/stan/lib/stan_math/lib/boost_1.69.0 -Ipystan/stan/lib/stan_math/lib/sundials_4.1.0/include -IC:\Program Files (x86)\python39\V_3.9.8\soft\WPy64\python-3.9.8.amd64\include -IC:\Program Files (x86)\python39\V_3.9.8\soft\WPy64\python-3.9.8.amd64\Include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\ATLMFC\include -IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include /EHsc /Tppystan/_api.cpp /Fobuild\temp.win-amd64-cpython-39\Release\pystan\_api.obj /EHsc -DBOOST_DATE_TIME_NO_LIB /std:c++14" failed with exit status 2
Any help is priceless !
Many thanks in advance

how do I change debug to release using conan manager, msvc and cmake

Using conan manager with build_type=Release, the generator still uses Debug configuration see below. I don't want to use any additional .json file to setup the behavior. Any idea how to do that by using conan manager?
I found out that this:
cmake --build . --config Release -j
command changes debug configuration to release but I don't know how to do that in conan.
[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=16
build_type=Release
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\HostX64\x64\CL.exe /c /IC:.conan\f23e85\1\include /IC:.conan\733d7c\1\include /Zi /nologo /W3 /WX- /diagnostics:column /Od /Ob0 /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR="Debug"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"MyOpenCV.dir\Debug\" /Fd"MyOpenCV.dir\Debug\vc142.pdb" /Gd /TP /errorReport:queue C:\Users\Peter\source\repos\MyOpenCV\src\main.cpp
main.cpp
Solution to my question
missing setup in CMakeLists.txt file from generated conanbuildinfo.cmake file
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
and at the end
conan_target_link_libraries(MyOpenCV)

Cython compiler directive language_level not respected

I am working with compiler directives for Cython (http://docs.cython.org/en/latest/src/reference/compilation.html#globally).
$ cat temp.pyx
# cython: language_level=3
print("abc", "def", sep=" ,") # invalid in python 2
Compiling:
$ cythonize -i world_dep.pyx
Error compiling Cython file:
------------------------------------------------------------
...
# cython: language_level=3
print("abc", "def", sep=" ,") ^
------------------------------------------------------------
temp.pyx:4:23: Expected ')', found '='
So language_level directive is not getting respected. Thus, cythonize ends up using Python 2 semantics and the error is thrown as the print statement above is invalid in Python 2.
However, including any Python statement makes this work:
$ cat temp.pyx
# cython: language_level=3
import os
print("abc", "def", sep=" ,")
Compiling and executing:
$ cythonize -i temp.pyx; python -c "import temp"
abc, def
Any idea how the import statement is making the language_level to be respected?
I have raised this same issue on the Cython GitHub repository as well?
As commented this bug is fixed:
$ /mnt/c/Python36/Scripts/cython.exe --version
Cython version 0.29.8
$ /mnt/c/Python36/Scripts/cythonize.exe -a -i temp.pyx
Compiling C:\Users\name\Documents\code\benchmark\temp.pyx because it changed.
[1/1] Cythonizing C:\Users\name\Documents\code\benchmark\temp.pyx
running build_ext
building 'temp' extension
creating C:\Users\name\Documents\code\benchmark\tmpw0giz82d\Release
creating C:\Users\name\Documents\code\benchmark\tmpw0giz82d\Release\Users
creating C:\Users\name\Documents\code\benchmark\tmpw0giz82d\Release\Users\name
creating C:\Users\name\Documents\code\benchmark\tmpw0giz82d\Release\Users\name\Documents
creating C:\Users\name\Documents\code\benchmark\tmpw0giz82d\Release\Users\name\Documents\code
creating C:\Users\name\Documents\code\benchmark\tmpw0giz82d\Release\Users\name\Documents\code\benchmark
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\name\appdata\local\programs\python\python36\inc
lude -Ic:\users\name\appdata\local\programs\python\python36\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows K
its\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)
\Windows Kits\8.1\include\winrt" /TcC:\Users\name\Documents\code\benchmark\temp.c /FoC:\Users\name\Documents\code\benchmark\tmpw0giz82d\Release\Users\name\Documents
\code\benchmark\temp.obj
temp.c
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:c:\users\e1220
41\appdata\local\programs\python\python36\libs /LIBPATH:c:\users\name\appdata\local\programs\python\python36\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visu
al Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64
" /EXPORT:PyInit_temp C:\Users\name\Documents\code\benchmark\tmpw0giz82d\Release\Users\name\Documents\code\benchmark\temp.obj /OUT:C:\Users\name\Documents\code\benc
hmark\temp.cp36-win_amd64.pyd /IMPLIB:C:\Users\name\Documents\code\benchmark\tmpw0giz82d\Release\Users\name\Documents\code\benchmark\temp.cp36-win_amd64.lib
temp.obj : warning LNK4197: export 'PyInit_temp' specified multiple times; using first specification
Creating library C:\Users\name\Documents\code\benchmark\tmpw0giz82d\Release\Users\name\Documents\code\benchmark\temp.cp36-win_amd64.lib and object C:\Users\name\
Documents\code\benchmark\tmpw0giz82d\Release\Users\name\Documents\code\benchmark\temp.cp36-win_amd64.exp
Generating code
Finished generating code

Compiling cuda in VS2012: fatal error C1083: Cannot open compiler generated file, no such file or directory

I've installed Visual Studio 2012 and the CUDA 6.0 toolkit. I can start a new project and select the CUDA 6.0 Runtime, but when I try to compile, it apparently can't find the object file.
This is the output for the sample code that comes when creating a CUDA project, although I get the same problem even if it's just a normal C program without any CUDA syntax.
Here is the full output I get when building kernel.cu:
1>------ Build started: Project: Temp, Configuration: Debug Win32 ------
1>Build started 08/06/2014 13:14:40.
1>PrepareForBuild:
1> Creating directory "d:\my documents\visual studio 2012\Projects\Temp\Debug\".
1>InitializeBuildStatus:
1> Creating "Debug\Temp.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>CudaBuild:
1> Compiling CUDA source file kernel.cu...
1>
1> D:\Programming>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\bin\nvcc.exe" -gencode=arch=compute_10,code=\"sm_10,compute_10\" --use-local-env --cl-version 2012 -ccbin "D:\Programs\VC\bin" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\include" -G --keep-dir Debug -maxrregcount=0 --machine 32 --compile -cudart static -g -DWIN32 -D_DEBUG -D_CONSOLE -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /Zi /RTC1 /MDd " -o Debug\kernel.cu.obj "d:\my documents\visual studio 2012\Projects\Temp\Temp\kernel.cu"
1>nvcc : warning : The 'compute_10' and 'sm_10' architectures are deprecated, and may be removed in a future release.
1> kernel.cu
1>C:\Users\Mort\AppData\Local\Temp\tmpxft_00001d3c_00000000-20_kernel.ii : fatal error C1083: Cannot open compiler generated file: 'Debug/kernel.cu.obj': No such file or directory
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\BuildCustomizations\CUDA 6.0.targets(597,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\bin\nvcc.exe" -gencode=arch=compute_10,code=\"sm_10,compute_10\" --use-local-env --cl-version 2012 -ccbin "D:\Programs\VC\bin" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.0\include" -G --keep-dir Debug -maxrregcount=0 --machine 32 --compile -cudart static -g -DWIN32 -D_DEBUG -D_CONSOLE -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /Zi /RTC1 /MDd " -o Debug\kernel.cu.obj "d:\my documents\visual studio 2012\Projects\Temp\Temp\kernel.cu"" exited with code 1.
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:03.36
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I'm running Win7 64 bit and VS 2012 Ultimate.
Thanks!
I'm making this an answer since it solved your problem: there seems to be a mismatch between NVCC's path (D:\Programming) and your project's path.
You might end up compiling stuff in the wrong directory and then failing to find the temporaries created by the previous phase. Make sure to fix those paths and the compilation should proceed just fine since everything else matches (i.e. bitness/include paths)

Compiling Visual c++ programs from the command line and msvcr90.dll

When I compile my Visual c++ 2008 express program from inside the IDE and redistribute it on another computer, It starts up fine without any dll dependencies that I haven't accounted for. When I compile the same program from the visual c++ 2008 command line under the start menu and redistribute it to the other computer, it looks for msvcr90.dll at start-up.
Here is how it is compiled from the command line
cl /Fomain.obj /c main.cpp /nologo -O2 -DNDEBUG /MD /ID:(list of include directories)
link /nologo /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup /OUT:Build\myprogram.ex
e /LIBPATH:D:\libs (list of libraries)
and here is how the IDE builds it based on the relevant parts of the build log.
/O2 /Oi /GL /I clude" /I (list of includes) /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /FD /EHsc /MD /Gy /Yu"stdafx.h" /Fp"Release\myprogram" /Fo"Release\\" /Fd"Release\vc90.pdb" /W3 /c /Zi /TP /wd4250 /vd2
Creating command line "cl.exe #d:\myprogram\Release\RSP00000118003188.rsp /nologo /errorReport:prompt"
/OUT:"D:\myprgram\Release\myprgram.exe" /INCREMENTAL:NO /LIBPATH:"d:\gtkmm\lib" /MANIFEST /MANIFESTFILE:"Release\myprogam.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"d:\myprogram\Release\myprogram.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /LTCG /ENTRY:"mainCRTStartup" /DYNAMICBASE /NXCOMPAT /MACHINE:X86 (list of libraries)
Creating command line "link.exe #d:\myprogram\Release\RSP00000218003188.rsp /NOLOGO /ERRORREPORT:PROMPT"
/outputresource:"..\Release\myprogram.exe;#1" /manifest
.\Release\myprogram.exe.intermediate.manifest
Creating command line "mt.exe #d:\myprogram\Release\RSP00000318003188.rsp /nologo"
I would like to be able to compile it from the command line and not have it look for such a late version of the runtime dll, like the version compiled from the IDE seems not to do. Both versions pass /MD to the compiler, so i am not sure what to do.
I know it is not exactly what you are looking for but you can invoke the ide build form the command line and it should give you the same output:
devenv solution.sln /build Release
This will build the Release configuration for solution.sln. (devenv /? on the command line for more info).

Resources