Skip to content
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

pythonPackages.ovito: init at 3.0.0 #46846

Merged
merged 1 commit into from Nov 12, 2018
Merged

Conversation

costrouc
Copy link
Member

Motivation for this change

ovito is a visualization package for visualizing molecules and doing quick analysis.

Things done

pythonPackages.ovito: init at 3.0.0

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@costrouc
Copy link
Member Author

costrouc commented Sep 18, 2018

Currently builds but I am running into a QT error when trying to run the binary.

/nix/store/2xgw34ydjhkdhq18wd448qprm4j6nwrf-ovito-3.0.0/bin $ ./ovito
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

aborted (core dumped)

I have seen similar errors. Is this how the fix is done?

  postFixup = ''
     wrapProgram $out/bin/ovito \
         --prefix QT_PLUGIN_PATH : "${pkgs.qt5.qtbase}/${pkgs.qt5.qtbase.qtPluginPrefix}"
  '';

Any help would be much appreciated!

@FRidh
Copy link
Member

FRidh commented Sep 18, 2018

It's typically not possible to run a Qt application from the store, because Qt applications are impure, that is, they check for certain things in your nix-profile. Install it with e.g. nix-env and see what happens. Note it may still fail when the Qt version is different from the one installed system-wide.

@costrouc
Copy link
Member Author

Tried to run it in a pure nix-shell environment however it still segfaulted...

let pkgs = import <nixpkgs> { config = { }; };
in
pkgs.mkShell {
  buildInputs = [ pkgs.python36Packages.ovito ];

  shellHook = ''
    export QT_PLUGIN_PATH=${pkgs.qt5.qtbase.bin}/${pkgs.qt5.qtbase.qtPluginPrefix}
  '';
}

@costrouc costrouc force-pushed the costrouc/ovito-init branch 2 times, most recently from d5a8a05 to 89dbb3b Compare October 14, 2018 13:46
@costrouc costrouc changed the title [WIP] pythonPackages.ovito: init at 3.0.0 pythonPackages.ovito: init at 3.0.0 Oct 14, 2018
@costrouc
Copy link
Member Author

Fixed and ready to merge. I have tested that the qt5 application works in NixOS. The QT5 documentation on nixpkgs was invaluable for fixing the issue.

@costrouc
Copy link
Member Author

@GrahamcOfBorg build python36Packages.ovito

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: python36Packages.ovito

Partial log (click to expand)

[ 24%] Built target PyScript_PCH
[ 24%] Built target Gui_PCH
[ 24%] Built target StdObjGui_PCH
[ 24%] Built target StdModGui_PCH
[ 24%] Built target ParticlesGui_PCH
[ 24%] Linking CXX shared library ../../../lib/ovito/libQwt.so
[ 24%] Built target Qwt
make: *** [Makefile:163: all] Error 2
builder for '/nix/store/r89lm06ws66rbfvqcql8n1mnffjip6x1-ovito-3.0.0.drv' failed with exit code 2
error: build of '/nix/store/r89lm06ws66rbfvqcql8n1mnffjip6x1-ovito-3.0.0.drv' failed

@GrahamcOfBorg
Copy link

Timed out, unknown build status on x86_64-linux (full log)

Attempted: python36Packages.ovito

Partial log (click to expand)

[ 72%] Building CXX object src/plugins/particles/CMakeFiles/Particles.dir/modifier/analysis/bondangle/BondAngleAnalysisModifier.cpp.o
[ 73%] Building CXX object src/plugins/particles/CMakeFiles/Particles.dir/modifier/analysis/cna/CommonNeighborAnalysisModifier.cpp.o
[ 73%] Building CXX object src/plugins/particles/CMakeFiles/Particles.dir/modifier/analysis/coordination/CoordinationNumberModifier.cpp.o
[ 73%] Building CXX object src/plugins/particles/CMakeFiles/Particles.dir/modifier/analysis/displacements/CalculateDisplacementsModifier.cpp.o
[ 73%] Building CXX object src/plugins/particles/CMakeFiles/Particles.dir/modifier/analysis/centrosymmetry/CentroSymmetryModifier.cpp.o
[ 73%] Building CXX object src/plugins/particles/CMakeFiles/Particles.dir/modifier/analysis/strain/AtomicStrainModifier.cpp.o
[ 73%] Building CXX object src/plugins/particles/CMakeFiles/Particles.dir/modifier/analysis/diamond/IdentifyDiamondModifier.cpp.o
[ 73%] Building CXX object src/plugins/particles/CMakeFiles/Particles.dir/modifier/analysis/voronoi/VoronoiAnalysisModifier.cpp.o
building of '/nix/store/qxx4adgwxsij6gk9sw4bik0vzlfrfpnm-ovito-3.0.0.drv' timed out after 3600 seconds
error: build of '/nix/store/qxx4adgwxsij6gk9sw4bik0vzlfrfpnm-ovito-3.0.0.drv' failed

@costrouc
Copy link
Member Author

This package takes a long time to build but I can promise that it works on x86_64-linux

@costrouc
Copy link
Member Author

Bump. Ready for merge. Build takes over an hour and I can verify that the qt application works.

@FRidh
Copy link
Member

FRidh commented Nov 4, 2018

If it's a Python library, then it needs to be moved under python-modules/.

pkgs/applications/science/chemistry/ovito/default.nix Outdated Show resolved Hide resolved
pkgs/top-level/python-packages.nix Outdated Show resolved Hide resolved
@costrouc
Copy link
Member Author

costrouc commented Nov 4, 2018

Fixed. Move to python-modules, added toPythonModule, and removed pkgs from derivation.

@FRidh
Copy link
Member

FRidh commented Nov 6, 2018

I just has a look at the source code, and they vendor a lot. It's likely a lot of work to replace their vendored dependencies with our Nixpkgs builds, however, I don't think it is reasonable to let Hydra build this package.

@costrouc
Copy link
Member Author

costrouc commented Nov 6, 2018

What if I were to patchelf the binary that they provide? https://ovito.org/index.php/download

Not ideal but would make the build trivial.

@FRidh
Copy link
Member

FRidh commented Nov 6, 2018

Not sure if it would actually work well, considering also the Python dependencies.
In any case, you can have it like this but set platforms = [] so Hydra won't build it.

@costrouc
Copy link
Member Author

costrouc commented Nov 6, 2018

Fixed. Set platforms = [ ].

@FRidh
Copy link
Member

FRidh commented Nov 6, 2018

Ah, wait, it was hydraPlatforms. See the Nixpkgs manual.

@costrouc
Copy link
Member Author

costrouc commented Nov 6, 2018

Makes more sense thanks for showing me that. Fixed with `hydraPlayforms = [ ];'

@costrouc
Copy link
Member Author

Bump. Ready for merge. I have added hydraPlatforms = [ ]. No actual builds will be done on hydra.

@FRidh FRidh merged commit c618667 into NixOS:master Nov 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants