CCAS is a Julia wrapper for the MIT-LL libcas (ACAS X) C library and interface. (libcas not included)
Ritchie Lee, [email protected]
Dependencies:
- Libcas distribution
- Visual Studio 2013 redistributable for Windows dll (Windows only)
- Clone CCAS package into your Julia packages folder.
- Create a folder for the libcas distribution. e.g., CCAS/libcas0.10.1, and create the following subfolders and put the corresponding libcas distribution files into the respective folders:
- CCAS/libcas0.10.1/interface to contain all the .h header files
- CCAS/libcas0.10.1/parameters to contain all the configuration files.
- CCAS/libcas0.10.1/lib to contain the dll or so binary library.
- Edit the configuration file to use the absolute paths to the dependent parameter files.
Dependencies:
- Boost C++ Libraries >1.46.0
- Boost::Extensions (Put the Extensions folder inside your Boost folder alongside the other component folders, see Downloads section) To build libccas from source (Windows):
- Go to CCAS/libccas/src/Build
- Choose Visual Studio target and run CMake on .. (parent directory). Note: CMake will try to automatically find your Boost installation. If Boost is unable to find it, you can specify the directory manually by defining the BOOST_ROOT environment variable.
- Build the generated solution file, then build the INSTALL project. INSTALL will automatically put the files in the correct folders.
To build libccas from source (Linux):
- Go to CCAS/libccas/src/Build
- cmake .. Note: If cmake isn't able to automatically detect your boost installation, try setting the BOOST_ROOT environment variable.
- make
- make install
Testing your installation of CCAS:
- Start a Julia session at CCAS/test
- include("runtests.jl")
- runtest(libcas, libcas_config), where libcas is path to libcas dynamic library, and libcas_config is path to main parameter file.
- It should complete without errors and you should see author information, libcas version, some ACAS X output (including dh_min=-9999.0, dh_max=9999.0), No Errors, and Done!
#!text
CCAS/ Package - Top level
libccas/ C wrapper for libcas that stands between Julia and libcas
libccas/doc Libccas documentation
libccas/include Libccas header files
libccas/lib Libccas library files
libccas/src Libccas C source files
libccas/src/Build Libccas CMake build directory
libccas/VS Visual Studio projects for debugging libccas
src/ Julia module source
test/ Julia module tests
#!text
using CCAS
#define constants
const LIBCAS_CONFIG = Pkg.dir("CCAS/libcas/parameters/0.8.3.standard.r13.config.txt")
const LIBCAS_LIB = Pkg.dir("CCAS/libcas/lib/libcas.dll")
consts = Constants(25, LIBCAS_CONFIG, 1)
cas = CASShared(consts,LIBCAS_LIB) #main cas object
nintruders = max_intruders(cas)
inputVals = InputVals(nintruders) #create input structure
outputVals = OutputVals(nintruders) #create output structure
reset(cas) #reset the cas
#loop start
#populate inputVals here...
#...
update!(cas,inputVals,outputVals)
#read output from outputVals here
#...
#read and handle error messages
errorMsg = error_msg(cas)
println( errorMsg == nothing ? "No Errors" : errorMsg )
#loop end
Last Updated: 11/3/2016