-
Notifications
You must be signed in to change notification settings - Fork 56
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
Hints to build with Win10 / VS2019 / Python 3.7 #28
Comments
May want to try https://github.com/pyomeca/ezc3d |
Thanks for the link! I'll look into it |
@incensesmoke Could you push the changes you did to your fork of BTK? I would really love to get conda-forge to build conda packages of BTK for Python 3. |
Enable Python 3 build Moved the *.tpp includes from the .h to the .cpp. Fix the problem with using BTK in other libraries (like OpenSim) on Windows. Problem -- Including the BTK headers causes an error on Windows with VS2015. " .... cstdint: 'uint8_t' is not a member of global namespace .... ". The error appears to be in the standard library but is actually caused by the fact that Utilities/stdint.h is included for MSVC builds and the directory Utilities is in the include path for the compiler. When trying to search for a header named stdint.h, the compiler keeps running into Utilities/stdint.h even when the original intention was to find the header in the system standard path. Solution -- Rename the file Utilities/stdint.h to something else that does not conflict with standard library header of the same name therefore avoiding compiler choosing this header when standard library header is meant to be found. Fix RPATH for OSX. Fix from Biomechanical-ToolKit#28 Remove xrange
Enable Python 3 build Moved the *.tpp includes from the .h to the .cpp. Fix the problem with using BTK in other libraries (like OpenSim) on Windows. Problem -- Including the BTK headers causes an error on Windows with VS2015. " .... cstdint: 'uint8_t' is not a member of global namespace .... ". The error appears to be in the standard library but is actually caused by the fact that Utilities/stdint.h is included for MSVC builds and the directory Utilities is in the include path for the compiler. When trying to search for a header named stdint.h, the compiler keeps running into Utilities/stdint.h even when the original intention was to find the header in the system standard path. Solution -- Rename the file Utilities/stdint.h to something else that does not conflict with standard library header of the same name therefore avoiding compiler choosing this header when standard library header is meant to be found. Fix RPATH for OSX. Fix from Biomechanical-ToolKit#28 Remove xrange Avoid tr1 with VS2017 Biomechanical-ToolKit#28
I have created a conda package for BTK which supports Python 3. It can be installed with:
It currently has support for Windows. If anyone would help getting Linux/mac working that would great. I don't think it will be hard, I just haven't had the opportunity to try other compilers. The build recipe is here: I hope this will serve for anyone who needs BTK for older projects but can't use Python 2.7. I will not recommend it for new projects since BTK development has stopped. Thanks a lot to: also thanks to: |
Hi Morten
Sound good.
Just one question : have you run all native implemented unit tests ?
regards
Fabien
Le jeu. 9 janv. 2020 à 14:53, Morten Enemark Lund <notifications@github.com>
a écrit :
… I have create a conda package for BTK which supports Python 3. It can be
installed with:
conda install -c conda-forge btk
It currently has support for Windows. If anyone would help getting
Linux/mac working that would great. I don't think it will be hard, I just
haven't had the opportunity to try other compilers.
The build recipe is here:
https://github.com/conda-forge/btk-feedstock
I hope this will serve for anyone who needs BTK for older projects but
can't use Python 2.7. I will not recommend it for new projects since BTK
development has stopped.
Thanks a lot to:
@allardhoeve <https://github.com/allardhoeve>, @klshrinidhi
<https://github.com/klshrinidhi>, @chrisdembia
<https://github.com/chrisdembia>, @aroy-hc <https://github.com/aroy-hc>
for all your fixes and commits which help get BTK Python 3 support.
also thanks to:
@incensesmoke <https://github.com/incensesmoke>, @CameronJGrant
<https://github.com/CameronJGrant>, @aaa34169
<https://github.com/aaa34169>, @jjnurminen <https://github.com/jjnurminen>,
@demotu <https://github.com/demotu>
Your posts and comments different places on Github helped me a lot to get
the build working.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#28?email_source=notifications&email_token=AAXUMBLTMSIQWAZ5LCJQJQTQ44T6PA5CNFSM4JSNGRI2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIQL3NY#issuecomment-572571063>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXUMBLITOWVTZRSYLAJQGTQ44T6PANCNFSM4JSNGRIQ>
.
--
Fabien
----------------------------------------------------------------------------------------------
Fabien Leboeuf
Ingénieur "analyste du mouvement" du Pole 10, CHU Nantes, France
Chercheur associé de l'Université de Salford, Manchester, Royaume uni
Laboraratoire d'analyse du mouvement
85 rue saint Jacques
44093 Nantes, FRANCE
------------------------------------------------------------------------------------------------
|
Good question and the answer is yes. The conda build recipe is setup to do that as part of the build. The build can only succeed if all the tests pass. I had to adapt the test runner a little bit to handle the setup on the CI server used by conda forge. You can see it here: |
well done. i have not seen you used circle-ci.
Envoyé de mon iPhone
… Le 9 janv. 2020 à 19:36, Morten Enemark Lund ***@***.***> a écrit :
Good question and the answer is yes. The conda build recipe is setup to do that as part of the build. The build can only succeed if all the tests pass.
I had to adapt the test runner a little bit to handle the setup on the CI server used by conda forge. You can see it here:
https://github.com/conda-forge/btk-feedstock/blob/master/recipe/run_test.py
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I actually have no idea. I guess it is possible these days using wheels. But I think packages like this is exactly what conda is for. Distributing binaries with the python and real tracking of dependencies. |
@melund Thanks, this is great! Installs and works without a hitch on Win10 64-bit/Python 3.7. |
@melund Now that you established the build procedure, would it be possible to also build a 2.7 version of btk into conda-forge with small effort? I know this may sound silly, but I still need to maintain 2.7/3.7 versions of my package for some time. It would be great to be able to get the same btk conda-forge dependency regardless of whether Python 2.7 or 3.7 is used. |
I don't know if conda forge still supports building 2.7 packages. You can try to make a PR to the recipe where you change the 3.6 restriction. The CI system should then build a 2.7 version to check the PR. If 2.7 is supported that is :) |
@melund I tried, let's see what happens. Was not 100% sure about the syntax of the yaml file... |
It doesn't seem to do anything. I don't think conda forge builds for 2.7 any more. |
Ok, thanks. On quick googling, I couldn't find any mention of conda-forge dropping 2.7 though. Maybe I'll try again later. |
@jjnurminen Wait. I think the automatic CI generation removes the 2.7 build scripts when the recipe excludes python 2.7. I tried to re-render the recipe and now 2.7 is available: We will see if also works. Maybe the Python 3 patch needs to be removed for 2.7 |
Looks like the build failed, cannot find numpy? |
Enable Python 3 build Moved the *.tpp includes from the .h to the .cpp. Fix the problem with using BTK in other libraries (like OpenSim) on Windows. Problem -- Including the BTK headers causes an error on Windows with VS2015. " .... cstdint: 'uint8_t' is not a member of global namespace .... ". The error appears to be in the standard library but is actually caused by the fact that Utilities/stdint.h is included for MSVC builds and the directory Utilities is in the include path for the compiler. When trying to search for a header named stdint.h, the compiler keeps running into Utilities/stdint.h even when the original intention was to find the header in the system standard path. Solution -- Rename the file Utilities/stdint.h to something else that does not conflict with standard library header of the same name therefore avoiding compiler choosing this header when standard library header is meant to be found. Fix RPATH for OSX. Fix from Biomechanical-ToolKit#28 Remove xrange Avoid tr1 with VS2017 Biomechanical-ToolKit#28 Fix problem with test Fixes a problem with unittest.assertAlmostEqual not working on numpy ndarrays. Reporting that ndarray doesn't have a __round__ methods. Fix test error
Enable Python 3 build Moved the *.tpp includes from the .h to the .cpp. Fix the problem with using BTK in other libraries (like OpenSim) on Windows. Problem -- Including the BTK headers causes an error on Windows with VS2015. " .... cstdint: 'uint8_t' is not a member of global namespace .... ". The error appears to be in the standard library but is actually caused by the fact that Utilities/stdint.h is included for MSVC builds and the directory Utilities is in the include path for the compiler. When trying to search for a header named stdint.h, the compiler keeps running into Utilities/stdint.h even when the original intention was to find the header in the system standard path. Solution -- Rename the file Utilities/stdint.h to something else that does not conflict with standard library header of the same name therefore avoiding compiler choosing this header when standard library header is meant to be found. Fix RPATH for OSX. Fix from Biomechanical-ToolKit#28 Remove xrange Avoid tr1 with VS2017 Biomechanical-ToolKit#28 Fix problem with test Fixes a problem with unittest.assertAlmostEqual not working on numpy ndarrays. Reporting that ndarray doesn't have a __round__ methods. Fix test error
Hi @melund and others I ran into an issue. With Python 2.7, I used to convert strings to latin1, which btk ate happily:
With Python 3, the SWIG interface apparently eats Python 3 string type directly. So the above would simply read:
Still good. However, using non-ASCII chars (which are rather common in Finnish):
even if the file actually exists. I tried encoding to UTF-8, but that results in
Any idea how we could get correct support for non-ASCII filenames? Maybe some compile-time flag for the SWIG interface? |
That's weird, I verified that I get a |
Does it help if you put |
@melund no, it doesn't seem to help. But strangely, the above code works just fine on another Windows 10 machine. So I suspect this particular Windows box has some special locale settings or whatever that screws things up. Anyway, thank you. |
Hello, morten, i try to recompile your btk code ( branch tagged python3 ) . Unfortunaly i ran into an issue when the compiler try to wrap the code in python. my configuration is : at [98% ] Linking CXX shared module to ....\bin_btk.pyd repeated for other method of btkC3DFileIO.obj I am not an expert in c++ compilation and appreciate any help. maybe @chrisdembia, share with us his expertise regards Fabien |
@aaa34169 Did you see how I build it here. Note, the patch I apply. But I guess you get that implicitly by building of the python 3 branch. Though I can't recall it You can try to clone the repository from conda-forge
It requires that you have a mini-conda installation, the conda-build package installed, a working c compiler (visual studio). But then the script should install the necessary dependencies (cmake,swig, jom) and run the build. Maybe that will help you figure out what is wrong with your build setup. Why do you want to build it your self? |
thanks morten
I want to figure out what is wrong with c3d file containing a non-ascii
character ( for example : "staticé.c3d")
I installed your package and if you test by your own you will see that
btkFileReader doesn t find the file !
It s weird. In python 3, management of unicode should be moire simple.
There is something wrong with windows machine only . (that work fine on
linux). I suspect that come from swig and mapping of : const std::string&
@jussi Nurminen <jjnurminen@gmail.com> : from your previous email, you
apparently managed to work with finnish accent, didn t you ! any secret?
Le ven. 7 août 2020 à 23:21, Morten Enemark Lund <notifications@github.com>
a écrit :
… @aaa34169 <https://github.com/aaa34169> Did you see how I build it here.
Note, the patch I apply. But I guess you get that implicitly by building of
the python 3 branch. Though I can't recall it
.
You can try to clone the repository from conda-forge
https://github.com/conda-forge/btk-feedstock
and then run
conda build recipe
It requires that you have a mini-conda installation, the conda-build
package installed, a working c compiler (visual studio). But then the
script should install the necessary dependencies (cmake,swig, jom) and run
the build. Maybe that will help you figure out what is wrong with your
build setup.
Why do you want to build it your self?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#28 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXUMBPMAFX6Q4IPUTDVMZDR7RV4TANCNFSM4JSNGRIQ>
.
--
Fabien
----------------------------------------------------------------------------------------------
Fabien Leboeuf
Ingénieur "analyste du mouvement" du Pole 10, CHU Nantes, France
Chercheur associé de l'Université de Salford, Manchester, Royaume uni
Laboraratoire d'analyse du mouvement
85 rue saint Jacques
44093 Nantes, FRANCE
------------------------------------------------------------------------------------------------
|
@aaa34169 it's probably related to Windows locale or language settings. I'll try to figure it out. |
For a Win10/VS2019 build with a Python3.7 wrapper and SWIG4.0.1 I had to make the following changes in the current master BTK-core:
#ifdef EIGEN_VECTOROP_PLUGIN
#include EIGEN_VECTOROP_PLUGIN
#endif
Perhaps this can save somebody else some trouble. As a n00b this took me a long time to figure out ;) Now it passes all tests and I'm happy!
Edit: spelling
The text was updated successfully, but these errors were encountered: