diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2bff31af..844e6bec 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,12 +35,4 @@ jobs: if: ${{ needs.build_and_test_linux.result == 'success' }} uses: ./.github/workflows/windows-reusable.yml with: - linux_status: ${{ needs.build_and_test_linux.result }} - - javascript_package: - name: JavaScript Package (WebAssembly) - needs: build_and_test_linux - if: ${{ needs.build_and_test_linux.result == 'success' }} - uses: ./.github/workflows/webassembly-reusable.yml - with: - linux_status: ${{ needs.build_and_test_linux.result }} + linux_status: ${{ needs.build_and_test_linux.result }} \ No newline at end of file diff --git a/.github/workflows/webassembly-reusable.yml b/.github/workflows/webassembly-reusable.yml deleted file mode 100644 index 0b481fc8..00000000 --- a/.github/workflows/webassembly-reusable.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: JavaScript Package (WebAssembly) -permissions: - contents: read - pull-requests: write - -on: - workflow_call: - inputs: - linux_status: - description: 'Status of the Linux Build job' - required: true - type: string - -jobs: - javascript_package: - runs-on: ubuntu-latest - if: ${{ inputs.linux_status == 'success' }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Create local GSL directory - run: mkdir -p "${{ github.workspace }}/usr" - - - uses: mymindstorm/setup-emsdk@v14 - - - name: Cache compiled GSL - id: cache-gsl - uses: actions/cache@v4 - with: - path: ${{ github.workspace }}/usr - key: ${{ runner.os }}-gsl-${{ hashFiles('**/webassembly-reusable.yml') }} - restore-keys: | - ${{ runner.os }}-gsl- - ${{ runner.os }}- - - - name: Compile GSL for WebAssembly - if: steps.cache-gsl.outputs.cache-hit != 'true' - run: | - wget -q "http://ftpmirror.gnu.org/gnu/gsl/gsl-latest.tar.gz" - mkdir -p "${{ github.workspace }}/gsl-latest" - tar -xzf gsl-latest.tar.gz -C "${{ github.workspace }}/gsl-latest" - mv "${{ github.workspace }}/gsl-latest/"* "${{ github.workspace }}/gsl-latest/gsl" - mkdir -p "${{ github.workspace }}/usr" - cd "${{ github.workspace }}/gsl-latest/gsl" && emconfigure ./configure --prefix="${{ github.workspace }}/usr" --disable-shared && emmake make -j && emmake make install - ls -al "${{ github.workspace }}/usr/lib/" - ls -al "${{ github.workspace }}/usr/include/" - - - name: Build WebAssembly Package - working-directory: distributions/JavaScript - env: - GSL_INCLUDE_DIRS: "${{ github.workspace }}/usr/include" - GSL_LIBRARY: "${{ github.workspace }}/usr/lib/libgsl.a" - GSL_CBLAS_LIBRARY: "${{ github.workspace }}/usr/lib/libgslcblas.a" - run: ./compile_to_js.sh - - - name: Upload WebAssembly Artifact - uses: actions/upload-artifact@v4 - with: - name: libamtrack-wasm - path: | - distributions/JavaScript/output/libat.wasm - distributions/JavaScript/output/libat.js - if-no-files-found: error - retention-days: 5 diff --git a/distributions/Java/README.md b/distributions/Java/README.md new file mode 100644 index 00000000..49c7d0a6 --- /dev/null +++ b/distributions/Java/README.md @@ -0,0 +1,192 @@ +# Java GUI for libamtrack (Unmaintained) + +> **Note:** This code is not actively maintained. Contributors are welcome! + +## Prerequisites + +To compile the Java GUI for libamtrack, you need the following: + +1. **Web browser** (preferably Firefox) with Java support installed ([Java Runtime Environment](http://java.sun.com/javase/downloads/index.jsp)) + +2. **GCC compiler** (preferably v4.0+). Linux users usually have it by default. Windows users can download + port of GCC for windows - MinGW compiler (Minimalist GNU for Windows), from the [MinGW webpage](http://www.mingw.org/). + +3. **Java JDK**, for example Sun Java SE v1.6 ([download](http://java.sun.com/javase/downloads/widget/jdk6.jsp)) + +4. **Swig interface compiler**, preferably v1.3. On most Linux platforms it's available in the repositories as `swig` package. + Windows users can download it from the [SWIG project webpage](http://www.swig.org/download.html). + +5. **GNU Scientific Library** ([GSL](http://www.gnu.org/software/gsl/)). On most Linux platforms, it's available in the repositories (please install + also `-dev` version of packages). Windows users can download it from [GnuWin32](http://gnuwin32.sourceforge.net/packages/gsl.htm) + + + + +## Compilation + +### Windows systems + +Locate file `wrapper\Java\make_jar.bat` and setup following variables: + +```bat +set swigexe="Z:\swig\swig.exe" +set jarsignerexe="C:\Program Files\Java\jdk1.6.0_18\bin\jarsigner.exe" +set javacexe="C:\Program Files\Java\jdk1.6.0_18\bin\javac.exe" +set jarexe="C:\Program Files\Java\jdk1.6.0_18\bin\jar.exe" +set javaincludeA="C:\Program Files\Java\jdk1.6.0_18\include" +set javaincludeB="C:\Program Files\Java\jdk1.6.0_18\include\win32" +set gslinclude="C:\Program Files\GnuWin32\include" +set gsllib="C:\Program Files\GnuWin32\lib" +set gsldllA="C:\Program Files\GnuWin32\bin\libgsl.dll" +set gsldllB="C:\Program Files\GnuWin32\bin\libgslcblas.dll" +set gccexe="C:\Program Files\MinGW\bin\gcc.exe" +``` + +Start Windows command line (`Start → Run → cmd.exe`), go to the directory +containing `make_jar.bat` file (using `cd` command) and run it (typing `make_jar.bat`). + +### Linux systems + +Locate file `distributions\Java\make_jar.sh` and setup following variables: + +```sh +SWIGEXE=swig +JARSIGNEREXE=jarsigner +JAVACEXE=javac +JAREXE=jar +JAVAINCLUDEA="/usr/lib/jvm/java-6-sun/include/" +JAVAINCLUDEB="/usr/lib/jvm/java-6-sun/include/linux" +GSLINCLUDE="/usr/include" +GSLLIB="/usr/lib" +GSLDLLA="/usr/lib/libgsl.so" +GSLDLLB="/usr/lib/libgslcblas.so" +GCCEXE=gcc +``` + +Here if you have everything properly installed you will need only to adjust +Java include path (you can locate them by trying to find `jni.h` file using +command `locate jni.h`) and GSL libraries (locate `libgsl.so`). + +Start your favorite console, go to the directory +containing `make_jar.sh` file (using `cd` command) and run it (typing `./make_jar.sh`). + + + +## Compilation details + +Both `make_jar` scripts do the same job, just with slightly different parameters of compiler. + +### Step 1. Generate interface elements using SWIG + +First - please read [SWIG tutorial](http://www.swig.org/tutorial.html), then please +inspect file `example.i`. This file includes header files from libamtrack C library and contains list +of functions that we will use in GUI. + +Command: +```sh +swig -java -o c-swig-src/$SWIGWRAPPER.c -outdir java-swig-src example.i +``` + +will create interface files which consist of two sets: + +A) **C interface** (`*.c`) which will be saved into `c-swig-src` directory and will be later compiled +together with the C libamtrack library + +B) **Java interface files** (`*.java`) which will be saved into `java-swig-src` directory and will be +later compiled with Java libamtrack GUI + +> **Note:** Please do not commit generated files into the repository. + + +### Step 2. Compile libamtrack C library + SWIG C wrapper + +In this step all the `*.c` files will be compiled to the `*.o` files (these +will go to `obj` directory). SWIG C wrappers need to be compiled +with Java JDK include directory as they contain JNI stubs. + +Finally all `*.o` files and necessary libraries (GSL) will be linked together +to create C library file (`example.dll` or `libamtrack.so` respectively). + +Please note that there is difference in compilation flags: +- Windows: `-fno-strict-aliasing` +- Linux: `-fPIC` + +and in linking flags: +- Windows: `-mno-cygwin -Wl,--add-stdcall-alias` +- Linux: *(none specified)* + + +### Step 3. Compile Java GUI + +All Java source files (`*.java`) will be compiled in this +step to the Java bytecode (`*.class`): + +```sh +$JAVACEXE java-swig-src/*.java src/*.java -d bin/ +``` + +Compilation is done on SWIG generated stubs and on JAVA GUI source files. +Generated `*.class` files will be saved in the `bin` directory. + + +### Step 4. Create JAR file + +Java bytecode files (`*.class`), manifest file together with libamtrack C library +and with GSL libraries will be packed into a JAR file: + +```sh +$JAREXE cvfm example.jar MANIFEST.MF *.class libexample.so libgsl.so libgslcblas.so +``` + +or + +```bat +%jarexe% cvfm example.jar MANIFEST.MF *.class example.dll libgsl.dll libgslcblas.dll +``` + +Previously generated `*.class` files are deleted in this step. + +Generated `example.jar` file can be now used as local GUI. +Can be started by typing command: +```sh +java -jar example.jar +``` + + +### Step 5. Sign JAR file + +All JAR files that need to be used in Java Web Start technology +need to be signed. I've prepared self-signed certificate, stored +in `myk` file. During signing process it will ask for password, which +is "libamtrack". If you want to generate your own certificate, +please use command: +```sh +keytool -genkey -keystore myk -alias jdc +``` + +Signed JAR file will be saved as `webstart/examplesigned-Linux.jar` or +`webstart/examplesigned-Windows.jar`. + + +### Step 6. Deploying Web Start Application + +In order to run generated JAR archive from within web browser +you will need to adjust `*.jnlp` file. Please inspect +`webstart/libamtrack-linux.jnlp` or `webstart/libamtrack-windows.jnlp` +respectively. + +In the second line of that file you will find: +```xml + +``` + +Instead of XXX you need to put URL. If you test how the applet works +locally, please put there local URL, like: +`file:///home/libamtrack/workspace/AmTrack_reorgan/wrapper/Java/webstart` +if you test it on the webserver, put there usual URL: +`http://libamtrack.dkfz.org/libamtrack` + +This URL should point to location where JAR file is stored. + +There is also `webstart/HelloWorld.html` file with links to jnlp files. + diff --git a/distributions/Java/README.txt b/distributions/Java/README.txt deleted file mode 100644 index 29858871..00000000 --- a/distributions/Java/README.txt +++ /dev/null @@ -1,186 +0,0 @@ -================================================================================================================================== -= Prerequisites - -In order to compile Java GUI for libamtrack following things needs to be installed: - -1. Web browser (preferably Firefox) with Java support installed (Java Java Runtime Environment, see http://java.sun.com/javase/downloads/index.jsp) - -2. GCC compiler (preferably v.4.0+) . Linux user usually have it by default. Windows users can download - port of GCC for windows - MinGW compiler (Minimalist GNU for Windows), from the webpage http://www.mingw.org/. - -3. Java JDK, for example Sun Java SE v1.6 (visit http://java.sun.com/javase/downloads/widget/jdk6.jsp) - -4. Swig interface compiler, preferably v1.3. On most linux platform it available in the repositories as swig package. -Windows users can download it from project webpage (visit http://www.swig.org/download.html). - -5. GNU Scientific Library (http://www.gnu.org/software/gsl/). On most linux platforms it is avalaible in the repositories (please install -also -dev version of packages). Windows users can download it from here: http://gnuwin32.sourceforge.net/packages/gsl.htm - - - - -================================================================================================================================== -= Compilation - - -========================================== -== Windows systems - -Locate file wrapper\Java\make_jar.bat and setup following variables: - -set swigexe="Z:\swig\swig.exe" -set jarsignerexe="C:\Program Files\Java\jdk1.6.0_18\bin\jarsigner.exe" -set javacexe="C:\Program Files\Java\jdk1.6.0_18\bin\javac.exe" -set jarexe="C:\Program Files\Java\jdk1.6.0_18\bin\jar.exe" -set javaincludeA="C:\Program Files\Java\jdk1.6.0_18\include" -set javaincludeB="C:\Program Files\Java\jdk1.6.0_18\include\win32" -set gslinclude="C:\Program Files\GnuWin32\include" -set gsllib="C:\Program Files\GnuWin32\lib" -set gsldllA="C:\Program Files\GnuWin32\bin\libgsl.dll" -set gsldllB="C:\Program Files\GnuWin32\bin\libgslcblas.dll" -set gccexe="C:\Program Files\MinGW\bin\gcc.exe" - -Start windows command line (start -> Run -> cmd.exe), go to the directory -containing make_jar.bat file (using cd command) and run it (typing make_jar.bat). - - -========================================== -== Linux systems - -Locate file distributions\Java\make_jar.sh and setup following variables: - -SWIGEXE=swig -JARSIGNEREXE=jarsigner -JAVACEXE=javac -JAREXE=jar -JAVAINCLUDEA="/usr/lib/jvm/java-6-sun/include/" -JAVAINCLUDEB="/usr/lib/jvm/java-6-sun/include/linux" -GSLINCLUDE="/usr/include" -GSLLIB="/usr/lib" -GSLDLLA="/usr/lib/libgsl.so" -GSLDLLB="/usr/lib/libgslcblas.so" -GCCEXE=gcc - -Here if you have everything properly installed you will need only to adjust -java include path (you can locate them by trying to find jni.h file using -comand locate jni.h) and gsl libraries (locate libgsl.so). - -Start your favorite console, go to the directory -containing make_jar.sh file (using cd command) and run it (typing ./make_jar.sh). - - - -================================================================================================================================== -= Compilation details - - -Both make_jar scripts do the same job, just with slightly different parameters of compiler. - -========================================== -== Step 1. Generate interface elements using SWIG - - -First - please read SWIG tutorial : http://www.swig.org/tutorial.html then please -inspect file example.i -This file includes header files from libamtrack C library and contains list -of function that we will use in GUI. - -Command -swig -java -o c-swig-src/$SWIGWRAPPER.c -outdir java-swig-src example.i -will create interface files which consist of two sets: - -A) C interface (*.c) which will be saved into c-swig-src directory and will be later compiled -together with the C libramtrack library -B) Java interface files (*.java) which will be saved into java-swig-src directory and will be -later compiled with Java libamtrack GUI - -Please do not commit generated files into repository. - - -========================================== -== Step 2. Compile libamtrack C library + SWIG C wrapper - - -In this step all the *.c files will be compiled to the *.o files (these -will go to obj directory). SWIG C wrappers needs to be compiled -with Java JDK include directory as they contains JNI stubs. - -Finally all *.o files and necessary libraries (GSL) will be linked together -to create C library file (example.dll or libamtrack.so respectively). - -Please note that there is difference in compilation flags: -Windows: -fno-strict-aliasing -Linux: -fPIC -and in linking flags: -Windows: -mno-cygwin -Wl,--add-stdcall-alias -Linux: - - -========================================== -== Step 3. Compile Java GUI - - -All java source files (*.java) will be compiled in this -step to the java bytecode (*.class): - -$JAVACEXE java-swig-src/*.java src/*.java -d bin/ - -Compilation is done on SWIG generated stubs and on JAVA GUI source files. -Generated *.class files will be save in bin directory. - - -========================================== -== Step 3. Create JAR file - - -Java bytecode files (*.class), manifest file together with libamtrack C library -and with GSL libraries will packed into JAR file. - -$JAREXE cvfm example.jar MANIFEST.MF *.class libexample.so libgsl.so libgslcblas.so -or -%jarexe% cvfm example.jar MANIFEST.MF *.class example.dll libgsl.dll libgslcblas.dll - -Previously generated *.class files are deleted in this step. - -Generated example.jar file can be now used as local GUI. -Can be started by typing command: -java -jar example.jar - - -========================================== -== Step 4. Sign JAR file - - -All JAR files that needs to be used in Java Web Start technology -needs to be signed. I've prepared self-signed certificate, stored -in myk file. During signing process it will ask for password, which -is "libamtrack". If you want to generate your own certificate, -please use command: -keytool -genkey -keystore myk -alias jdc - -Signed JAR file will be save as webstart/examplesigned-Linux.jar or -webstart/examplesigned-Windows.jar - - -========================================== -== Step 5. Deploying web start application - - -In order to run generated JAR archive from within web browser -you will need to adjust *.jnpl file. Please inspect -webstart/libamtrack-linux.jnlp or webstart/libamtrack-windows.jnlp -respectively. - -In the second line of that file you will find: - - -Instead of XX you need to put URL. If you test how the applet works -locally, please put there local URL, like: -file:///home/libamtrack/workspace/AmTrack_reorgan/wrapper/Java/webstart -if you test it on the webserver, put there usuall URL: -http://libamtrack.dkfz.org/libamtrack - -This URL should point to location where JAR file is stored. - -There is also webstart/HelloWorld.html file with links to jnlp files. - diff --git a/distributions/JavaScript/CMakeLists.txt b/distributions/JavaScript/CMakeLists.txt deleted file mode 100644 index b071785c..00000000 --- a/distributions/JavaScript/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -cmake_minimum_required(VERSION 3.7.2) -project(library C) -set(CMAKE_C_STANDARD 99) - -# FIND_PACKAGE(GSL REQUIRED) - doesn't work with `emcmake cmake`, while working with pure `cmake` - -file(GLOB SOURCE_FILES "../../src/*.c") - -include_directories( ${GSL_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/../../include ) - -add_library(at STATIC ${SOURCE_FILES}) -install(TARGETS at DESTINATION ../../lib) - -target_link_libraries(at ${GSL_LIBRARY} ${GSL_CBLAS_LIBRARY}) \ No newline at end of file diff --git a/distributions/JavaScript/JS_INSTALL b/distributions/JavaScript/JS_INSTALL deleted file mode 100644 index ea40d11b..00000000 --- a/distributions/JavaScript/JS_INSTALL +++ /dev/null @@ -1,49 +0,0 @@ -1. Download Emscripten and install according to the steps from: - http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html - If your PATH do not contains commands "emcmake","emmake","emcc" (emcmake Commands not found) - In file distributions/JavaScript/compile_to_js.sh - uncomment lines and change path to directory where your emscripten is, i.e.: - - export PATH=$PATH:/home/osboxes/emsdk/emscripten/1.37.36 - -2. Download gsl sources - (you can change path GSL_PATH to f.e. `mktemp -d` - or where you GSL sources are but do not forget change it in CMakeList.txt) - - GSL_PATH=$PWD - echo $GSL_PATH && cd $GSL_PATH && wget "http://ftpmirror.gnu.org/gnu/gsl/gsl-latest.tar.gz" - mkdir $GSL_PATH/gsl-latest && tar -xzf gsl-latest.tar.gz -C $GSL_PATH/gsl-latest - mv $GSL_PATH/gsl-latest/** $GSL_PATH/gsl-latest/gsl - rm -r $GSL_PATH/gsl-latest.tar.gz - - 2.1 And compile to LLVM bytecode (optional, replace -j4 with settings specific to no of CPU cores) - - GSL_ROOT_DIR=$GSL_PATH/gsl-latest/gsl/usr - cd $GSL_PATH/gsl-latest/gsl && emconfigure ./configure --prefix=$PWD/usr && emmake make -j && emmake make install && cd ../../ - - Move generated files to distributions/JavaScript/ (exec from main library dir) - cp $GSL_ROOT_DIR/lib/libgsl.a . - cp $GSL_ROOT_DIR/lib/libgslcblas.a . - - 2.2 If you skipped 2.1 do - cd $GSL_PATH/gsl-latest/gsl/ - ./configure - make -j - -3. (Optional) If you want export some of functions not all first, - regenerate list of functions : - - python3 parse_headers.py. - - Cut everything from funs.txt and put to compile_to_js.sh before line - - emcc libat.a libgsl.a -o libat.html -s WASM=$WASM -s EXPORT_ALL=1 -s EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]' - - and change this line to - emcc libat.a libgsl.a -o libat.html -s WASM=$WASM -s EXPORTED_FUNCTIONS="$funs" \ - -4. Run (exec from main_library_dir/distributions/JavaScript/) - export GSL_INCLUDE_DIRS=$GSL_ROOT_DIR/include - export GSL_LIBRARY=$GSL_ROOT_DIR/lib/libgsl.a - export GSL_CBLAS_LIBRARY=$GSL_ROOT_DIR/lib/libgslcblas.a - ./compile_to_js.sh diff --git a/distributions/JavaScript/README.md b/distributions/JavaScript/README.md new file mode 100644 index 00000000..5bfd4c02 --- /dev/null +++ b/distributions/JavaScript/README.md @@ -0,0 +1,21 @@ +# JavaScript Bindings for Library Distributions + +This repository provides JavaScript bindings for the core library distributions. + +> **Note:** WebAssembly bindings have been moved to a new repository: +> [https://github.com/libamtrack/web](https://github.com/libamtrack/web) + +Please visit the new repository for the latest WebAssembly support and updates. + +## Overview + +- JavaScript interface for library distributions +- Easy integration with web and Node.js projects + +## Getting Started + +Clone this repository and follow the instructions in the documentation to build and use the JavaScript bindings. + +## License + +Distributed under the terms of the project license. \ No newline at end of file diff --git a/distributions/JavaScript/compile_to_js.sh b/distributions/JavaScript/compile_to_js.sh deleted file mode 100755 index 7104f805..00000000 --- a/distributions/JavaScript/compile_to_js.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/bash - -if [ "$1" != "" ]; then - echo "WASM parameter set to $1" - WASM=$1 -else - echo "WASM parameter EMPTY !!! Default set to 1" - WASM=1 -fi - -rm -rf build - -emcmake cmake -DGSL_INCLUDE_DIRS=$GSL_INCLUDE_DIRS -DGSL_LIBRARY=$GSL_LIBRARY -DGSL_CBLAS_LIBRARY=$GSL_CBLAS_LIBRARY -S . -B build || exit 1 -emmake cmake --build build || exit 1 - -funs='[' - - - #----AT_DataParticle.h - funs+='"_AT_atomic_weight_from_particle_no_single",' - - #----AT_DataMaterial.h - funs+='"_AT_density_g_cm3_from_material_no",' - - #----AT_EnergyLoss.h - funs+='"_AT_Vavilov_energy_loss_distribution",' - funs+='"_AT_Gauss_energy_loss_distribution",' - funs+='"_AT_Landau_energy_loss_distribution",' - funs+='"_AT_energy_loss_distribution",' - - #----AT_StoppingPower.h - funs+='"_AT_Mass_Stopping_Power",' - funs+='"_AT_Stopping_Power",' - funs+='"_AT_Mass_Stopping_Power_with_no",' - funs+='"_AT_Stopping_Power_with_no",' - funs+='"_AT_Energy_MeV_u_from_Stopping_Power_single",' - - #----AT_ProtonAnalyticalModels.h - funs+='"_AT_dose_Bortfeld_Gy_multi",' - funs+='"_AT_dose_Bortfeld_Gy_single",' - funs+='"_AT_LET_t_Wilkens_keV_um_multi",' - funs+='"_AT_LET_d_Wilkens_keV_um_multi",' - funs+='"_AT_proton_RBE_multi",' - - #----AT_ProtonAnalyticalBeamParameters.h - funs+='"_AT_range_Bortfeld_cm",' - funs+='"_AT_fwhm_Bortfeld_cm",' - funs+='"_AT_max_plateau_Bortfeld",' - funs+='"_AT_energy_Bortfeld_MeV",' - funs+='"_AT_fit_Bortfeld",' - - #----AT_KatzModel_Implementation.h - funs+='"_AT_KatzModel_KatzExtTarget_inactivation_cross_section_m2",' - funs+='"_AT_KatzModel_CucinottaExtTarget_inactivation_cross_section_m2",' - funs+='"_AT_KatzModel_inactivation_cross_section_m2",' - - #----AT_PhysicsRoutines.h - funs+='"_AT_E_MeV_u_from_E_MeV",' - funs+='"_AT_E_MeV_from_E_MeV_u",' - funs+='"_AT_beta_from_E_single",' - funs+='"_AT_beta_from_E",' - funs+='"_AT_E_from_beta_single",' - funs+='"_AT_E_from_beta",' - funs+='"_AT_E_from_gamma_single",' - funs+='"_AT_E_from_gamma",' - funs+='"_AT_E_MeV_u_from_momentum_single",' - funs+='"_AT_E_MeV_u_from_momentum_MeV_c_u",' - funs+='"_AT_gamma_from_E_single",' - funs+='"_AT_gamma_from_E",' - funs+='"_AT_effective_charge_from_beta_single",' - funs+='"_AT_effective_charge_from_beta",' - funs+='"_AT_energy_straggling_MeV2_cm2_g",' - funs+='"_AT_energy_straggling_after_slab_E_MeV_u",' - funs+='"_AT_effective_charge_from_E_MeV_u_single",' - funs+='"_AT_effective_charge_from_E_MeV_u",' - funs+='"_AT_momentum_from_E_MeV_c_u_single",' - funs+='"_AT_momentum_MeV_c_u_from_E_MeV_u",' - funs+='"_AT_dose_Gy_from_fluence_cm2_single",' - funs+='"_AT_dose_Gy_from_fluence_cm2",' - funs+='"_AT_fluence_cm2_from_dose_Gy_single",' - funs+='"_AT_fluence_cm2_from_dose_Gy",' - funs+='"_AT_Q_from_E_single",' - funs+='"_AT_Qeff_from_E_single",' - - #----AT_RDD_ExtendedTarget.h - funs+='"_AT_RDD_ExtendedTarget_KatzPoint_integrand_Gy",' - funs+='"_AT_RDD_ExtendedTarget_KatzPoint_Gy_by_integration",' - funs+='"_AT_RDD_ExtendedTarget_KatzPoint_Gy",' - funs+='"_AT_RDD_ExtendedTarget_CucinottaPoint_Gy_by_integration",' - funs+='"_AT_RDD_ExtendedTarget_CucinottaPoint_Gy",' - - #----AT_ElectronRange.h - funs+='"_AT_max_electron_ranges_m",' - funs+='"_AT_max_electron_range_m",' - - #----AT_DataRange.h - funs+='"_AT_CSDA_range_g_cm2_multi",' - funs+='"_AT_CSDA_range_g_cm2_single",' - funs+='"_AT_CSDA_energy_after_slab_E_MeV_u_single",' - funs+='"_AT_CSDA_energy_after_slab_E_MeV_u_multi",' - - #----AT_D_RDD_Gy.h - funs+='"_AT_D_RDD_Gy",' - - # malloc needed to allocate memory in Module JS object - - funs+='"_malloc"' - - funs+=']' - -emcc build/libat.a $GSL_LIBRARY $GSL_CBLAS_LIBRARY -o output/libat.html -sWASM=$WASM -sEXPORTED_FUNCTIONS="$funs" -sEXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]' || exit 1 diff --git a/distributions/JavaScript/output/.gitkeep b/distributions/JavaScript/output/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/distributions/JavaScript/parse_headers.py b/distributions/JavaScript/parse_headers.py deleted file mode 100644 index fbeb6557..00000000 --- a/distributions/JavaScript/parse_headers.py +++ /dev/null @@ -1,66 +0,0 @@ -import os - -include_directory = os.fsencode("../../include") -function_types = ["int", "double", "long", "void"] -function_names = [] -inc_file_names = [] -function_counter = 0 - - -def browse_files(directory): - for file in os.listdir(directory): - filename = os.fsdecode(file) - inc_file_names.append(filename) - function_names.append(parse_file("../../include/" + filename)) - - -def parse_file(filename): - result = [] - - with open(filename, "r") as file: - lines = file.readlines() - - for line in lines: - split_line = line.split() - if len(split_line) >= 2 and split_line[0] in function_types: - if split_line[1][0] == "A": - result.append(split_line[1][:-1]) - - return result - - -def create_script(script_name): - i = 0 - - with open(script_name, "w") as file: - - file.write("\nfuns='['\n") - - for header in function_names: - file.write("\n#----" + inc_file_names[i] + "\n") - - for fun in header: - file.write("funs+='\"_" + fun + "\",' \n") - - i += 1 - - file.write("\nfuns+=']'\n") - - -def print_missing_files(directory): - print("Files not parsed: ") - - for file in os.listdir(directory): - filename = os.fsdecode(file) - - if filename not in inc_file_names: - print(filename) - - -def main(): - browse_files(include_directory) - create_script("funs.txt") - - -if __name__ == "__main__": - main() diff --git a/distributions/JavaScript/trigger_docker_rebuild.sh b/distributions/JavaScript/trigger_docker_rebuild.sh deleted file mode 100755 index b328c9d2..00000000 --- a/distributions/JavaScript/trigger_docker_rebuild.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -if [[ "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_BRANCH" == "master" ]] -then - curl -s -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "Travis-API-Version: 3" -H "Authorization: token $TRAVIS_TOKEN" -d '{ "request": { "branch":"master", "message": "Build Travis after changes in libamtrack/library" }}' https://api.travis-ci.com/repo/libamtrack%2FDockerFiles/requests -fi diff --git a/distributions/Linux/README.md b/distributions/Linux/README.md new file mode 100644 index 00000000..460025c0 --- /dev/null +++ b/distributions/Linux/README.md @@ -0,0 +1,6 @@ +# libamtrack Debian Packaging + +This directory contains scripts and files for packaging **libamtrack** as `.deb` files for installation on Ubuntu systems. + +**Current status:** Unknown, likely not fully working. +**Contributions:** Contributions and improvements are very welcome! \ No newline at end of file diff --git a/distributions/Matlab/README.md b/distributions/Matlab/README.md new file mode 100644 index 00000000..fef3d37f --- /dev/null +++ b/distributions/Matlab/README.md @@ -0,0 +1,12 @@ +# Matlab Wrapper for Library Distributions + +This directory contains the Matlab wrapper for the library's distribution functionalities. + +**Current Status:** +The state of this wrapper is currently unknown. It may be incomplete or require updates. + +## Contributing + +We welcome contributions from anyone interested in fixing, updating, or improving this Matlab wrapper. If you have experience with Matlab or this library, your help would be greatly appreciated! + +Feel free to open issues or submit pull requests. diff --git a/distributions/Python/pyamtrack/README.md b/distributions/Python/pyamtrack/README.md new file mode 100644 index 00000000..1a30d50a --- /dev/null +++ b/distributions/Python/pyamtrack/README.md @@ -0,0 +1,29 @@ +# pyamtrack + +This directory contains a Python wrapper for the [libamtrack](https://github.com/libamtrack/libamtrack) library, supporting versions up to **0.14.0**. + +## Latest Stable Release + +- **Version:** 0.14.0 +- **Release Date:** 2022-10-03 + +## Limitations of Version 0.14.0 + +- Only available as a binary wheel package for **Linux** (no support for Windows or macOS). +- No official documentation describing the available functions or usage examples. + +## Current Development + +Active development of pyamtrack has moved to a new repository: + +- **GitHub:** [https://github.com/libamtrack/pyamtrack/](https://github.com/libamtrack/pyamtrack/) +- **Documentation:** [https://libamtrack.github.io/docs/python/](https://libamtrack.github.io/docs/python/) + +Please refer to the new repository and documentation for the latest features, installation instructions, and usage guides. + +## Getting Help + +For questions, issues, or contributions, please use the [new GitHub repository](https://github.com/libamtrack/pyamtrack/). + +--- +This file documents the legacy Python wrapper for libamtrack up to version 0.14.0. \ No newline at end of file diff --git a/distributions/Python/pyamtrack/README.txt b/distributions/Python/pyamtrack/README.txt deleted file mode 100644 index bee5b548..00000000 --- a/distributions/Python/pyamtrack/README.txt +++ /dev/null @@ -1,3 +0,0 @@ -## Use cBinder - -https://github.com/Tetrite/cBinder \ No newline at end of file diff --git a/distributions/R/README.md b/distributions/R/README.md new file mode 100644 index 00000000..01254ccf --- /dev/null +++ b/distributions/R/README.md @@ -0,0 +1,8 @@ +# libamtrack R Plugin + +The **libamtrack R plugin** previously existed in the [CRAN repository](https://cran.r-project.org/web/packages/libamtrack/index.html), but was removed on 2019-09-03. + +This directory contains a **work in progress** on a new R package for libamtrack, aimed at physicists and researchers working with ion beam therapy and related applications. + +> **Note:** +> There is currently **no stable or working version** available. Contributions and feedback are welcome as development continues. diff --git a/distributions/README.md b/distributions/README.md new file mode 100644 index 00000000..a5b15098 --- /dev/null +++ b/distributions/README.md @@ -0,0 +1,63 @@ +# libamtrack Distributions + +This directory contains language-specific and platform-specific distributions of the libamtrack library. The libamtrack library provides computational routines for the prediction of detector response and radiobiological efficiency in heavy charged particle beams. + +## Directory Structure + +### Java + +- **Status:** Unmaintained +- **Description:** Contains Java GUI for libamtrack with compilation scripts for both Windows and Linux +- **Features:** + - Web-based interface with Java support + - Compilation scripts (make_jar.bat for Windows, make_jar.sh for Linux) + - SWIG interface for C/Java integration +- **Requirements:** Java JDK, SWIG, GSL, GCC compiler +- **Note:** Not actively maintained, contributors welcome + +### JavaScript + +- **Status:** active development moved to separate repository +- **Description:** Contains only an README.md file +- **Note:** Active development moved to https://github.com/libamtrack/web/ + +### Linux + +- **Status:** Unknown, likely not fully working +- **Description:** Contains scripts and files for Debian packaging of libamtrack +- **Features:** Creates .deb files for installation on Ubuntu systems +- **Note:** Contributions and improvements welcome + +### Matlab + +- **Status:** Unknown, potentially incomplete +- **Description:** Contains Matlab wrapper for library's distribution functionalities +- **Features:** + - Wrapper generation scripts + - NAMESPACE definitions +- **Note:** May require updates, contributions welcome + +### Python (pyamtrack) + +- **Status:** Legacy version 0.14.0 (2022-10-03), active development moved to separate repository +- **Description:** Python wrapper for libamtrack library +- **Features:** + - Binary wheel package for Linux only + - Scripts for wheel package generation and testing +- **Limitations:** + - No Windows or macOS support + - Limited documentation +- **Note:** Active development moved to https://github.com/libamtrack/pyamtrack/ + +### R + +- **Status:** Work in progress, no stable version available +- **Description:** R package for libamtrack aimed at physicists and researchers +- **History:** Previously existed in CRAN repository, removed in 2019 +- **Note:** Contributions and feedback welcome + +## Overall Status + +The libamtrack distributions are in varying states of maintenance. The Python distribution has been actively moved to a separate repository, while others (Java, Matlab, R) are either unmaintained or work in progress. Contributions to any of these distributions are welcome. + +For the latest information on libamtrack, refer to the main project repository and documentation.