Skip to content

VTK 7 (py2 and py3) #453

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

Merged
merged 23 commits into from Jun 24, 2016
Merged

VTK 7 (py2 and py3) #453

merged 23 commits into from Jun 24, 2016

Conversation

Korijn
Copy link
Contributor

@Korijn Korijn commented Apr 25, 2016

We built VTK 7 successfully using this recipe for the full range of Python versions (2.6, 2.7, 3.3, 3.4, 3.5) on x64 windows and linux architectures, so I reckon it should work on x86 and OS X as well.

The main reason for writing it is that the VTK package in the official anaconda channels is lagging behind and doesn't support python 3.x.

Looking forward to improving this recipe together with you all.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (recipes/vtk) and found some lint.

Here's what I've got...

For recipes/vtk:

  • When defining a source/url please add a sha256, sha1 or md5 checksum (sha256 preferably).

@Korijn Korijn mentioned this pull request Apr 25, 2016
@pelson
Copy link
Member

pelson commented Apr 25, 2016

Hi @Korijn! Thanks for submitting!

The main reason for writing it is that the VTK package in the official anaconda channels is lagging behind and doesn't support python 3.x.

Awesome. Glad conda-forge can help!

Looking forward to improving this recipe together with you all.

👍

The CI looks a bit scary when it is all red like that, but hopefully we can iterate on it. To break down the problems by OS:

Linux:

-- Found X11: /usr/lib64/libX11.so
CMake Error at Rendering/OpenGL2/CMakeLists.txt:177 (message):
  X11_Xt_LIB could not be found.  Required for VTK X lib.

I'm afraid I know very little about X11, but I notice that libxt isn't part of the manylinux spec. For now, you can add a yum_requirements.txt containing libXt-devel in your recipe directory to get the necessary build dependency (see https://github.com/conda-forge/staged-recipes/blob/master/scripts/run_docker_build.sh#L45 for how this has been implemented).

He is currently away, but @jakirkham may be able to help in deciding whether we need to package libxt within conda-forge, or whether we simply make it a requirement for using the conda-forge distribution.


OSX:

+ mkdir build
+ cd build
++ uname
+ '[' Darwin == Linux ']'
+ make -j2
make: *** No targets specified and no makefile found.  Stop.
Command failed: /bin/bash -x -e /Users/travis/build/conda-forge/staged-recipes/recipes/vtk/build.sh

Windows. Took 43min on Py27, 1 hr (and timed out) on py34 x86.

The timeouts are problematic - we have an hour to build on item of the matrix, and unfortunately that is a hard limit put onto us from AppVeyor. I don't know that there is anything we can do about that in terms of either a) what we build or b) asking for longer.

The win x64 (py27):

C:\Miniconda-x64\conda-bld\work\VTK-7.0.0>REM ===== end generated header ===== 
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:29 (project):
  No CMAKE_C_COMPILER could be found.

CMake Error at CMakeLists.txt:29 (project):
  No CMAKE_CXX_COMPILER could be found.

-- Configuring incomplete, errors occurred!
See also "C:/Miniconda-x64/conda-bld/work/VTK-7.0.0/build/CMakeFiles/CMakeOutput.log".
See also "C:/Miniconda-x64/conda-bld/work/VTK-7.0.0/build/CMakeFiles/CMakeError.log".

Microsoft (R) Visual C++ Express Edition Version 9.0.30729.1.
Copyright (C) Microsoft Corp 2007. All rights reserved.

The following files were specified on the command line:

    VTK.sln

These files could not be found and will not be loaded. 
Microsoft (R) Visual C++ Express Edition Version 9.0.30729.1.
Copyright (C) Microsoft Corp 2007. All rights reserved.

The following files were specified on the command line:

    VTK.sln

These files could not be found and will not be loaded. 
Microsoft (R) Visual C++ Express Edition Version 9.0.30729.1.
Copyright (C) Microsoft Corp 2007. All rights reserved.

The following files were specified on the command line:

    VTK.sln

These files could not be found and will not be loaded. 
Microsoft (R) Visual C++ Express Edition Version 9.0.30729.1.
Copyright (C) Microsoft Corp 2007. All rights reserved.

The following files were specified on the command line:

    VTK.sln

These files could not be found and will not be loaded.Command failed: C:\Windows\system32\cmd.exe /c call bld.bat

Hope the failures aren't demoralizing - this is a really cool recipe to package and I'm super pleased you've submitted a PR to fix the current state of VTK on conda.`

@Korijn
Copy link
Contributor Author

Korijn commented Apr 25, 2016

I can address most of these problems. About the x64 2.7 build; do you have a custom identifier for the c compiler? This recipe is tested and working on a Windows 7 VM with VS2008 Pro SP1 which has the x64 compiler built-in.

@msarahan
Copy link
Member

I think the tricky part is that we have AppVeyor here. It uses VS 2008
Express, which has no x64 support. Instead, we use the VS Compiler for
Python 2.7, which is the same compiler, but no SDKs. That's what Conda
1.20.1 fixed primarily - the search order. Unfortunately, it brought in
other issues.

On Mon, Apr 25, 2016 at 5:30 PM Korijn van Golen [email protected]
wrote:

I can address most of these problems. About the x64 2.7 build; do you have
a custom identifier for the c compiler? This recipe is tested and working
on a Windows 7 VM with VS2008 Pro SP1 which has the x64 compiler built-in.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#453 (comment)

@jakirkham
Copy link
Member

So, I guess it is time to bring back the VS 2008 64-bit workaround ( #251 ). That didn't last long.

Unfortunately, it brought in other issues.

I take it you are aware of this issue ( #448 ) then. Did that move upstream? Do we have any idea of what is causing it.

@msarahan
Copy link
Member

msarahan commented Apr 25, 2016

I can't make sense of it right away. https://ci.appveyor.com/project/conda-forge/xonsh-feedstock/build/1.0.14/job/827pntj23q0xxt0p#L202 seems to be one issue - Windows 7.1 SDK not having the 64-bit compiler, possibly. I'm pretty sure @patricksnape tested that, though.

The other issue appears to be the same: https://ci.appveyor.com/project/conda-forge/staged-recipes/build/1.0.1375/job/jq2rrc7uwjb8iehw#L213

This should be a quick fix once we figure out what the correct value should be. I can help push a quick release.

PS: @patricksnape it is better to set variables like:

set "VARNAME=value"

rather than set VARNAME="value"

https://ci.appveyor.com/project/conda-forge/xonsh-feedstock/build/1.0.14/job/827pntj23q0xxt0p#L198

Both treat spaces well, but the former doesn't have quotes in the end variable value, and is easier to deal with.

Sorry I didn't catch this on the PR.

@jakirkham
Copy link
Member

Might need freeglut. Take a look at this comment ( #285 (comment) ).

@jakirkham
Copy link
Member

To help preserve our sanity, I moved the weird Windows build issue into this issue ( conda/conda-build#895 ). IMHO we have at least confirmed there is a conda-build bug at this point. Maybe we can focus the discussion there. Tracking it over multiple PRs, issues, and feedstocks is getting a little out of hand.

@jakirkham
Copy link
Member

Also, I'm wrong about needing that workaround. I forgot the new issue is restricted to Windows 64-bit Python 3.4. So, we shouldn't need the old VS 2008 64-bit workaround as the downgrade of conda-build is not needed on Python 2.7.

@jakirkham
Copy link
Member

Ignore the above. Also, don't dig any deeper. I know the cause.

@jakirkham
Copy link
Member

So, this PR ( #455 ) should fix things for you here at staged-recipes. Want to give it a try?

@pelson
Copy link
Member

pelson commented Apr 28, 2016

So, this PR ( #455 ) should fix things for you here at staged-recipes. Want to give it a try?

That is, just rebase this PR against upstream/master and get #455 pulled in.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipes/vtk) and found it was in an excellent condition.

@Korijn
Copy link
Contributor Author

Korijn commented Apr 29, 2016

Changes:

  • Rebased against upstream/master
  • Added sha1 checksum
  • Dropped mesa requirement in favor of freeglut
  • Added yum_requirements.txt for libXi-devel
  • Added .gitattributes to guard newlines in build.sh

I'm not too sure what has to be done for OS X; I have no machine to test on.

cmake --build . --target INSTALL --config %BUILD_CONFIG%
if errorlevel 1 exit 1

exit /b 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a terminal newline.

@jakirkham
Copy link
Member

Is it possible to disable X11 support on Mac? If so, that's what I would do here.

@Korijn
Copy link
Contributor Author

Korijn commented Apr 29, 2016

I'm clueless about X11 and also about Mac. There's probably a cmake flag to disable it.

@jakirkham
Copy link
Member

There is. Just set this on Mac only -DVTK_USE_X:BOOL=OFF.

@jakirkham
Copy link
Member

The thing with Mac is they used to have X11 support baked in, but they decided to drop it. Though one can still install it and Apple still supports this open source effort. It is just something we can't expect to find on the user's system. Maybe one day we can add a package to install it in a conda environment. Until then, disabling is the right way to go.

@jakirkham
Copy link
Member

So, I don't think he mentioned it, but @msarahan had a recipe for this that was in the process of being added. Not to speak for him, but you seem motivated to get this in and I think we are happy to see someone pushing this forward so please continue (plus I'm sure @msarahan has tons on his plate and doesn't mind someone taking this off it 😉). Though you might be able to pick up a few useful things from his recipe, which can be found in this PR ( #285 ).

@jakirkham
Copy link
Member

@stuarteberg, given your use of VTK, maybe you have some useful feedback here. Please feel free to share.

-DPYTHON_LIBRARY:FILEPATH=$library_file_path
fi

make -j${CPU_COUNT}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we add ctest. Also, you may need this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have been a little cautious about using CPU_COUNT as the CIs don't always report this correctly. For instance, they may report the number of CPUs for the node you are on instead of noting how many of these you get. Could we try removing this? If the build time is too long, we can play with this more.

@stuarteberg
Copy link
Contributor

given your use of VTK, maybe you have some useful feedback here.

I don't have much to offer. I use a pretty old version of VTK. Recipe is here:
https://github.com/ilastik/ilastik-build-conda/blob/master/vtk/build.sh

One possible suggestion: Our recipe sets the -DVTK_USE_SYSTEM_ZLIB/PNG/JPEG/TIFF/LIBXML flags, just to make sure VTK is using the same version of those libraries that the rest of our conda packages are using. Not sure if that's a big deal.

REM tell cmake where Python is
set PYTHON_LIBRARY=%PREFIX%\libs\python%PY_VER:~0,1%%PY_VER:~2,1%.lib

cmake .. -G"%GENERATOR_NAME%" ^
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use NMake here too, if it fails on 2.7

@Korijn
Copy link
Contributor Author

Korijn commented Jun 23, 2016

We've rebased again, processed the comments, and cleaned up using the things we learned from the u3d recipe. Adding tests will be challenging and probably cause timeouts on the builds... but we'll see!

@ivoflipse
Copy link
Contributor

@thewtex or @dlonie Would any of you guys at Kitware mind having a look at our build scripts to see what we can do to get our VTK recipe working?

@Korijn
Copy link
Contributor Author

Korijn commented Jun 24, 2016

The good news:

  • Windows and Linux build scripts work for Python 2k and 3k.
  • I've built and installed both locally and run some test scripts to start a renderer; works!
  • OS X seems to be a simple fix, we're currently pointing to the python library incorrectly.

The bad news:

  • Timeouts are a problem, even with all optional components disabled:
    • Setting BUILD_TESTING:BOOL=ON triggers the downloading of external test data which increases build time with about 1 hour.
    • The Windows build takes about 2,5 hours per configuration.
    • The Linux build takes about 50 minutes per configuration.
    • As we want to build for x86/x64, py2.7, py3.4 and py3.5 (10 configurations in total), there is no way we'll be able to stay under the timeout limits of 1 hour on Windows (AppVeyor), 2 hours on Linux (CircleCI) and 50 minutes on OS X (Travis CI).

I'm currently working under a tight schedule and need to get at least the Linux packages out there. I would like to propose the following:

  • skip Windows: not even 1 configuration will complete before the build timeout
  • skip OS X: we don't have access to OS X systems to work on the build script
  • restrict Linux to x64 py2.7 and x64 py.35: it should complete for these 2 important configurations before the build timeout

We should then get green light on the CI and be able to merge. We can then open a new PR on the feedstock where we'll work on:

  • the build timeout issues on CI so we can get all configurations out there, also for Windows
  • proper testing
  • possibly supporting features (e.g. Matplotlib) that e.g. Mayavi needs.

@jakirkham, thoughts?

@ocefpaf
Copy link
Member

ocefpaf commented Jun 24, 2016

I'm currently working under a tight schedule and need to get at least the Linux packages out there. I would like to propose the following:

  • skip Windows: not even 1 configuration will complete before the build timeout
  • skip OS X: we don't have access to OS X systems to work on the build script
  • restrict Linux to x64 py2.7 and x64 py.35: it should complete for these 2 important configurations before the build timeout

@Korijn that is a sound strategy (I did something similar with gdal some time ago).

👍

@Korijn
Copy link
Contributor Author

Korijn commented Jun 24, 2016

@ocefpaf cool. I commited the proposed changes, let's see if CI turns all-green.

@ocefpaf
Copy link
Member

ocefpaf commented Jun 24, 2016

Fingers crossed!

-DCMAKE_BUILD_TYPE=$BUILD_CONFIG \
-DCMAKE_INSTALL_PREFIX:PATH="${PREFIX}" \
-DCMAKE_INSTALL_RPATH:PATH="${PREFIX}/lib" \
-DINSTALL_PKGCONFIG_DIR:PATH=$PKG_CONFIG_PATH \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

INSTALL_PKGCONFIG_DIR is unused according to a CMake warning. will remove that in future PR.

@Korijn
Copy link
Contributor Author

Korijn commented Jun 24, 2016

@ocefpaf can we merge? I'll open a PR on the feedstock directly afterwards.

@ocefpaf ocefpaf merged commit e8c8e9f into conda-forge:master Jun 24, 2016
@ocefpaf
Copy link
Member

ocefpaf commented Jun 24, 2016

Thanks @Korijn! I know the pain to fight against the CI limitations. Thanks for leading this effort!

@jakirkham
Copy link
Member

  • Timeouts are a problem, even with all optional components disabled:
    • Setting BUILD_TESTING:BOOL=ON triggers the downloading of external test data which increases build time with about 1 hour.
    • The Windows build takes about 2,5 hours per configuration.
    • The Linux build takes about 50 minutes per configuration.
    • As we want to build for x86/x64, py2.7, py3.4 and py3.5 (10 configurations in total), there is no way we'll be able to stay under the timeout limits of 1 hour on Windows (AppVeyor), 2 hours on Linux (CircleCI) and 50 minutes on OS X (Travis CI).

We had the same rough experience adding OpenCV, @Korijn. This sounds totally sensible to me. I'm glad this was added as is.

Also, good job getting this to build. 🎉

@thewtex
Copy link
Member

thewtex commented Jun 24, 2016

CC: @demarle @cryos @vibraphone

@Korijn
Copy link
Contributor Author

Korijn commented Jun 24, 2016

This work is continued here:

conda-forge/vtk-feedstock#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.