Skip to content

Commit

Permalink
Avoid name clashes
Browse files Browse the repository at this point in the history
  • Loading branch information
peremato committed Dec 4, 2024
1 parent 659b29b commit b5fef1f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions advanced/EmbedJulia/JuliaAction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"cell_type": "code",
"source": [
"Base.run(`c++ -O2 -fPIC $cflags -I$jlprefix/include/julia $ldflags $g4libs $jllibs\n",
" -o G4example $(@__DIR__)/G4example.cpp`).exitcode == 0 || error(\"Compilation failed\");"
" -o G4example.exe $(@__DIR__)/G4example.cpp`).exitcode == 0 || error(\"Compilation failed\");"
],
"metadata": {},
"execution_count": null
Expand All @@ -139,7 +139,7 @@
"cell_type": "code",
"source": [
"withenv(\"JULIA_PROJECT\" => \"@.\", \"G4NUMTHREADS\" => \"8\") do\n",
" Base.run(`./G4example`).exitcode == 0 || error(\"Execution failed\")\n",
" Base.run(`./G4example.exe`).exitcode == 0 || error(\"Execution failed\")\n",
"end"
],
"metadata": {},
Expand Down
4 changes: 2 additions & 2 deletions advanced/EmbedJulia/JuliaAction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ ldflags = ["-Wl,-rpath,$g4prefix/lib", "-Wl,-rpath,$jlprefix/lib"];
Sys.KERNEL == :Linux && append!(ldflags, ["-Wl,--no-as-needed"]);

Base.run(`c++ -O2 -fPIC $cflags -I$jlprefix/include/julia $ldflags $g4libs $jllibs
-o G4example $(@__DIR__)/G4example.cpp`).exitcode == 0 || error("Compilation failed");
-o G4example.exe $(@__DIR__)/G4example.cpp`).exitcode == 0 || error("Compilation failed");

withenv("JULIA_PROJECT" => "@.", "G4NUMTHREADS" => "8") do
Base.run(`./G4example`).exitcode == 0 || error("Execution failed")
Base.run(`./G4example.exe`).exitcode == 0 || error("Execution failed")
end

println("=====> The file edepHist.png should have been saved")
4 changes: 2 additions & 2 deletions advanced/EmbedJulia/JuliaAction_lit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ Sys.KERNEL == :Linux && append!(ldflags, ["-Wl,--no-as-needed"]);

# Run the compilation and link command
Base.run(`c++ -O2 -fPIC $cflags -I$jlprefix/include/julia $ldflags $g4libs $jllibs
-o G4example $(@__DIR__)/G4example.cpp`).exitcode == 0 || error("Compilation failed");
-o G4example.exe $(@__DIR__)/G4example.cpp`).exitcode == 0 || error("Compilation failed");

# ## Run the application
# We need to set the variable `JULIA_PROJECT` pointing to correctly setup Julia environment.
withenv("JULIA_PROJECT" => "@.", "G4NUMTHREADS" => "8") do
Base.run(`./G4example`).exitcode == 0 || error("Execution failed")
Base.run(`./G4example.exe`).exitcode == 0 || error("Execution failed")
end

# ## Display the results
Expand Down

0 comments on commit b5fef1f

Please sign in to comment.