Skip to content

Commit a66cdbc

Browse files
committed
Allow using PARMA from arbitrary pwd.
1 parent 949fbab commit a66cdbc

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

parma/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33

44
all: parma.dylib
55

6-
%.o: %.cpp
7-
$(CXX) -g -c $<
6+
COMPILEFLAGS := -D__PARMAPATH__=\"$(shell pwd)\"
7+
8+
%.o: %.cpp Makefile
9+
$(CXX) $(COMPILEFLAGS) -g -c $<
810

911
parma.dylib: subroutines.o # jlparma.cpp
1012
$(CXX) -g -o $@ -shared -fPIC $(CXXFLAGS) $^

parma/subroutines.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <cmath>
88
using namespace std;
99

10-
const string INPUTDIR("parma/input/");
10+
const string INPUTDIR(string(__PARMAPATH__)+"/input/");
1111

1212
// **********************************************************
1313
double getRfromECpp(int iz, int ia, double Ek, double Em) // get Rigidity in MV from Kinetic Energy (MeV/n)

src/parma.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function parmaID(p::Particle)
2222
nothing
2323
end
2424

25-
const ParmaCompiledLibrary = "parma/parma"
25+
const ParmaCompiledLibrary = pkgdir(@__MODULE__, "parma", "parma")
2626

2727
"""
2828
Parma_getHP(year::Integer, month::Integer, day::Integer)

0 commit comments

Comments
 (0)