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

Habemus Macam #82

Merged
merged 15 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
os: [ubuntu-22.04, macos-12]
py: [311]
allow-fail: [false]
include:
- os: macos-12
py: 311
allow-fail: true

steps:
- uses: actions/checkout@v3.5.3
Expand Down
1 change: 1 addition & 0 deletions client_side_tests/test_fetch_content_recompile.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e

tmp_dir=$(mktemp -d -t nain4-recompile-XXXXXX)
test_dir=$(dirname "$(readlink -f "$0")")
Expand Down
58 changes: 40 additions & 18 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,51 @@
enableRaytracerX11 = false;
});

# Should be able to remove this, once https://github.com/NixOS/nixpkgs/issues/234710 is merged
clang_16 = if pkgs.stdenv.isDarwin
then pkgs.llvmPackages_16.clang.override rec {
libc = pkgs.darwin.Libsystem;
bintools = pkgs.bintools.override { inherit libc; };
inherit (pkgs.llvmPackages) libcxx;
extraPackages = [
pkgs.llvmPackages.libcxxabi
# Use the compiler-rt associated with clang, but use the libc++abi from the stdenv
# to avoid linking against two different versions (for the same reasons as above).
(pkgs.llvmPackages_16.compiler-rt.override {
inherit (pkgs.llvmPackages) libcxxabi;
})
];
}
else pkgs.llvmPackages.clang;

my-packages = with pkgs; [
my-geant4
geant4.data.G4PhotonEvaporation
geant4.data.G4EMLOW
geant4.data.G4RadioactiveDecay
geant4.data.G4ENSDFSTATE
geant4.data.G4SAIDDATA
geant4.data.G4PARTICLEXS
geant4.data.G4NDL
clang_16
clang-tools
cmake
cmake-language-server
catch2_3
just
gnused # For hacking CMAKE_EXPORT stuff into CMakeLists.txt
mdbook
] ++ lib.optionals stdenv.isDarwin [

] ++ lib.optionals stdenv.isLinux [
];
gonzaponte marked this conversation as resolved.
Show resolved Hide resolved

in {

devShell = pkgs.mkShell.override { stdenv = pkgs.clang_16.stdenv; } {
name = "G4-examples-devenv";

packages = with pkgs; [
my-geant4
geant4.data.G4PhotonEvaporation
geant4.data.G4EMLOW
geant4.data.G4RadioactiveDecay
geant4.data.G4ENSDFSTATE
geant4.data.G4SAIDDATA
geant4.data.G4PARTICLEXS
geant4.data.G4NDL
clang_16
clang-tools
cmake
cmake-language-server
catch2_3
just
gnused # For hacking CMAKE_EXPORT stuff into CMakeLists.txt
mdbook
];
packages = my-packages;

G4_DIR = "${pkgs.geant4}";
G4_EXAMPLES_DIR = "${pkgs.geant4}/share/Geant4-11.0.4/examples/";
Expand Down
8 changes: 8 additions & 0 deletions nain4/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ FILE(GLOB HEADERS ${PROJECT_SOURCE_DIR}/*.hh)

add_library(Nain4 SHARED ${SOURCES} ${HEADERS})

if(APPLE)
target_link_options(Nain4 PRIVATE -undefined dynamic_lookup)
endif()

#set_target_properties(Nain4 PROPERTIES ENABLE_EXPORTS ON)

#----------------------------------------------------------------------------
Expand Down Expand Up @@ -80,6 +84,10 @@ set(ALL_TEST_SOURCES
# TODO including headers in add_executable apparently makes them show up in IDEs. Verify how?
add_executable(nain4-tests ${ALL_TEST_SOURCES})

if(APPLE)
target_link_options(nain4-tests PRIVATE -undefined dynamic_lookup)
endif()


target_link_libraries(
nain4-tests
Expand Down
Loading