-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Windows using MSVC #5
Comments
@rolandzander FYI |
At least in combination of fmatvec with MBSim a so/dll of fmatvec is required: fmatvec uses boost::spirit for parsing vectors/matrices as well as symbolic expressions. Since vector/matrix/expressions are all templated we explicitly instantiate MANY common template variants in the so/dll. If not doing so all the boost::spirit code must be compiled in every program using fmatvec (MBSim). This increases the compile time of MBSim by factors. Handling of the lib file should work out of the box in cmake. All the declspec things for windows may be problematic for a dll, but I think its just work to do. |
@friedrichatgc I have found another compilation issue, I am not sure how to address. The friend declarations in class Operation are not considered by the MSVC compiler. Error is Fixed: Missing namespace confused MSVC - will drop a pull request to fix this. |
Initialized once and never modified.
MSVC requires some location in the memory for SymbolicExpression::constructSymbol to compile.
…plex.h MSVC does not consider the operators from linear_algebra_complex.h if they are declared after usage, e.g. in Vector operator*(&x, &alpha) {}
@friedrichatgc I would like to know your opinion about the dllexport/dllimport issues, when using MSVC. I played around with cmake / msvc but cannot make a final decision on that. gcc linux build exports about 2.000 symbols, mingw about 1.500 in total (global, weak, undefined, text, code, ...)
My thoughts about potential solutions:
|
I created a prototype in my fmatvec-fork with a combination of 4. and 5. : https://github.com/GreenGary/fmatvec/tree/2020-04-20-cmake-msvc |
…ebra_complex.h" This reverts commit 36059bb. Add template function declarations for complex types to linear_algebra.h
I think the best and most common way is option 2:
This is also the "todays" usual way for gcc and does not clutter gcc. But sure it requires a lot of changes in the code. |
@friedrichatgc I am currently setting up the required dll exports using __declspec. I noticed, that most matrixes have prepared shift operators, but not
Found while trying to build |
Building testfunction.cc should work without DiagMat explicitly noted in stream.h|.cc since testfunction.cc include stream_impl.h. So I don't know what is wrong here but we can also add DiagMat to stream.h|.cc. I have just pushed this (maybe you forgot to include diagonal_matrix.h). |
I have a draft for the library exports using
Since I do not know anything about SWIG, I can just guess, this error comes from the additional macro? |
I have added this branch to mbsim-env/fmatvec and enabled this branch for CI, see https://www.mbsim-env.de/mbsim/linux64-ci/report/result_0000000409/index.html |
mbsim/master is now updated to work with fmatvec/control-exported-symbols, see |
The staging build system at wwwstaging.mbsim-env.de (only accessible via IPv6) is now ready to build mbsim tools using cmake/ninja.
The first three are default cmake targets. The check target is also already implemented on the cmake branch. The doc/* targets are missing. This is also the reason for all failures of the doc build of all other tools. xmldoc/* is not needed for fmatvec. All failures seen on the staging build system seem to be related to missing parts of the cmake/ninja build of fmatvec. But now we have a working testing environment for the complete project using the cmake/ninja fmatvec variant. |
I will try to address the targets "doc/..." within the next two weeks.
Are there other open issues to be resolved before the cmake build can
fully be replacement when building fmatvec?
In case of fmatvec, I see no conflict in merging branch "cmake" to
"master". Shall we plan to extract the automake parts to a separate
branch and make "master" provide cmake including native Win build? Shall
both cmake and automake be continuously maintained.
Am 16.07.20 um 19:25 schrieb Markus Friedrich:
…
The staging build system at wwwstaging.mbsim-env.de (only accessible
via IPv6) is now ready to build mbsim tools using cmake/ninja.
The staging system is configured to use the fmatvec cmake branch as
default instead of the master branch.
If a CMakeLists.txt file is found in the basedir then cmake/ninja is
used, if not autotools are used for building.
The requirements of cmake/ninja based tools are that the following
targets exists:
* the default target = all = "none specified": build the actual tool
* clean: remove all files generated by all
* install: install the tool to CMAKE_INSTALL_PREFIX
* check: build and run "unit" tests of the tool
* doc/all (only if a subdir named doc exists): build doxygen
documentation
* doc/clean (only if a subdir named doc exists): clean the files
generated by doc/all
* doc/install (only if a subdir named doc exists): install the
doxygen documentation
* xmldoc/all (only if a subdir named xmldoc exists): build xml
documentation
* xmldoc/clean (only if a subdir named xmldoc exists): clean the
files generated by xmldoc/all
* xmldoc/install (only if a subdir named xmldoc exists): install the
xml documentation
The first three are default cmake targets. The check target is also
already implemented on the cmake branch. The doc/* targets are
missing. This is also the reason for all failures of the doc build of
all other tools. xmldoc/* is not needed for fmatvec.
All failures seen on the staging build system seem to be related to
missing parts of the cmake/ninja build of fmatvec. But now we have a
working testing environment for the complete project using the
cmake/ninja fmatvec variant.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADHK2DG4HANVZSMGPHZQR33R34ZYHANCNFSM4LWSC5KA>.
|
Just all issues on wwwstaging.mbsim-env.de must be resolved before merging. |
I would remove the autotools part from the cmake branch and if all works on wwwstaging merge it to master. Before merging fmatvec the staging branch of the build repo must be merged to master to enable cmake on www.mbsim-env.de. |
I successfully used LAPACK/BLAS with x86 builds from http://icl.cs.utk.edu/lapack-for-windows/lapack/LAPACKE_examples.zip - these were the only MSVC builds (not mingw) I found. Without an Intel Fortran on hands, I could not build myself. Roland links against IntelMKL. |
The CI system builds lapack/blas from source using mingw-cross-compiler, see https://github.com/mbsim-env/build/blob/master/docker/buildwin64Image/Dockerfile |
I try to fix the windows build testing and accouting for BLAS.
The boost-include path thing to me seems to be a problem of fmatvec AND h5plotserie: all other packages depending on fmatvec succeed in their build, and h5plotserie can not resolve include of boost/filesystem.h which is not required by fmatvec. Unfortunately I do also not find include directives in the fmatvec.pc of the autmake build+install, so no valid source for me to copy from! I now add include directive to cmake-generated fmatvec.pc since fmatvec definetly carries that dependency - still h5plotseries seems unclear to me.
|
Note that wwwstaging.mbsim-env.de is currently not running since everything is merged now to www.mbsim-env.de which does not CI also for the fmatvec cmake branch and also does the nightly builds (including windows) for the fmatvec cmake branch. See "Continuous Integration (CI) Linux64 Debug Build" and "Daily builds of none default branches" on www.mbsim-env.de You will see tomorrow the results of your changes their (these builds run between about 6:00 and 8:30). The boost include thing I see as a pure fmatvec problem since h5plotserie just correctly relies on the implicit dependency to boost which is brought in by fmatvec (all other tools just have a explicit dependency to boost either due to additional binary boost library requirements or due to historical reasons which fmatvec does not require boost at all). |
For the "doc" and "xmldoc" parts we might need different target names (for all/clean/insall), since cmake does not support the definition of target names with (forward) slashes, see https://gitlab.kitware.com/cmake/cmake/-/issues/20774. Kitware suggests to implement targets like "doc-all/doc-install/doc-clean" instead. |
I added it to the build system as target doc/all due to this issue https://gitlab.kitware.com/cmake/cmake/-/issues/16677 |
The drawback of adding results of target doc to install via cmake's install(DIRECTORY html ...) is that doc will be added to top level install target, which is in contrast to current behavior and would completely mix up current separation. Also I did not see a simple way to introduce the dependency of install on target doc in that case. |
I don't understand your comment but will change the targets to doc, doc-clean, doc-install. |
Based on preparation made in isse #4 , the library shall be usable on Windows using MSVC toolchain. Target would be MSVC++ 14.1 _MSC_VER == 1910 (Visual Studio 2017 version 15.0; support for Visual Studio < 2015 would require more refactorintg, see this Microsoft document.
Todos:
Remarks:
=> issue to be discussed!
The text was updated successfully, but these errors were encountered: