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

Merge pull request #75946 from davidtwco/computecpp-init #75946

Merged
merged 1 commit into from Jan 17, 2020

Conversation

davidtwco
Copy link
Member

Motivation for this change

Adds package for ComputeCpp.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nix-review --run "nix-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)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc me!

];
libaries = stdenv.lib.makeLibraryPath [
stdenv.cc.cc.lib
ncurses5
Copy link
Member Author

Choose a reason for hiding this comment

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

I'd appreciate advice from reviewers on how best to fix a issue with this package. When running the binary, I get the following output:

/nix/store/anf6w9ad9577d121w8v2jxhp9m09ycil-computecpp-1.2.0/bin/compute: /nix/store/7fnhs9lg64fgzx13d2skjrckiic2yqsk-ncurses-6.1-20190112-abi5-compat/lib/libtinfo.so.5: no version information available (required by /nix/store/anf6w9ad9577d121w8v2jxhp9m09ycil-computecpp-1.2.0/bin/compute)

I believe this is due to the original binary being compiled with an older version of libtinfo.so.5, but I'm not sure what I can do about that.

Copy link
Member

Choose a reason for hiding this comment

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

My guess is that libtinfo.so has been stripped of debug symbols. Does this prevent the program from starting?

Copy link
Member Author

Choose a reason for hiding this comment

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

It doesn't, it appears to work fine but just prints that message when invoked.

pkgs/development/compilers/computecpp/default.nix Outdated Show resolved Hide resolved
pkgs/development/compilers/computecpp/default.nix Outdated Show resolved Hide resolved
];
libaries = stdenv.lib.makeLibraryPath [
stdenv.cc.cc.lib
ncurses5
Copy link
Member

Choose a reason for hiding this comment

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

My guess is that libtinfo.so has been stripped of debug symbols. Does this prevent the program from starting?

Copy link
Member

@markuskowa markuskowa left a comment

Choose a reason for hiding this comment

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

The derivation looks good to me now but I am no expert in compiler integration. Maybe @bhipple @Ericson2314 @Mic92 @FRidh want to have a look?

@Mic92
Copy link
Member

Mic92 commented Jan 17, 2020

Right now it does not find the gcc/stdlibc++ headers:

[nix-shell:~/.cache/nixpkgs-review/pr-75946]$ cat main.cpp
#include <iostream>

int main() {
  std::cout << "Hello world" << std::endl;
  return 0;
}

[nix-shell:~/.cache/nixpkgs-review/pr-75946]$ cat main.c
#include <stdio.h>

int main() {
  printf("Hello world\n");
  return 0;
}
[nix-shell:~/.cache/nixpkgs-review/pr-75946]$ compute++ main.cpp -o main
/nix/store/ymhg9r0xambgxpzj0gh6l6lcnk69ykdq-computecpp-1.2.0/bin/compute++: /nix/store/cbl3mpw1hr0b6038j5m9mp9hi38iyjjx-ncurses-6.1-20190112-abi5-compat/lib/libtinfo.so.5: no version information available (required by /nix/store/ymhg9r0xambgxpzj0gh6l6lcnk69ykdq-computecpp-1.2.0/bin/compute++)
/nix/store/ymhg9r0xambgxpzj0gh6l6lcnk69ykdq-computecpp-1.2.0/bin/compute++: /nix/store/cbl3mpw1hr0b6038j5m9mp9hi38iyjjx-ncurses-6.1-20190112-abi5-compat/lib/libtinfo.so.5: no version information available (required by /nix/store/ymhg9r0xambgxpzj0gh6l6lcnk69ykdq-computecpp-1.2.0/bin/compute++)
main.cpp:1:10: fatal error: 'iostream' file not found
#include <iostream>
         ^~~~~~~~~~
1 error generated.

[nix-shell:~/.cache/nixpkgs-review/pr-75946]$ compute main.c -o main
/nix/store/ymhg9r0xambgxpzj0gh6l6lcnk69ykdq-computecpp-1.2.0/bin/compute: /nix/store/cbl3mpw1hr0b6038j5m9mp9hi38iyjjx-ncurses-6.1-20190112-abi5-compat/lib/libtinfo.so.5: no version information available (required by /nix/store/ymhg9r0xambgxpzj0gh6l6lcnk69ykdq-computecpp-1.2.0/bin/compute)
/nix/store/ymhg9r0xambgxpzj0gh6l6lcnk69ykdq-computecpp-1.2.0/bin/compute: /nix/store/cbl3mpw1hr0b6038j5m9mp9hi38iyjjx-ncurses-6.1-20190112-abi5-compat/lib/libtinfo.so.5: no version information available (required by /nix/store/ymhg9r0xambgxpzj0gh6l6lcnk69ykdq-computecpp-1.2.0/bin/compute)
In file included from main.c:1:
/nix/store/4v4ginzfvpsrnvafl1cxx1jn4wy6kc1r-glibc-2.27-dev/include/stdio.h:33:10: fatal error: 'stddef.h' file not found
#include <stddef.h>
         ^~~~~~~~~~
1 error generated.

@davidtwco
Copy link
Member Author

Right now it does not find the gcc/stdlibc++ headers:

I'll look into fixing this, thanks.

Signed-off-by: David Wood <david.wood@codeplay.com>
@davidtwco
Copy link
Member Author

@Mic92 I've updated the commit to fix that issue.

@Mic92 Mic92 changed the title computecpp: init at 1.2.0 Merge pull request #75946 from davidtwco/computecpp-init Jan 17, 2020
@Mic92 Mic92 merged commit b4d4f83 into NixOS:master Jan 17, 2020
@davidtwco davidtwco deleted the computecpp-init branch January 17, 2020 14:01
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