Skip to content

Commit

Permalink
xraylib release 2.13.0
Browse files Browse the repository at this point in the history
Final commit before merge into master branch
  • Loading branch information
tschoonj committed Mar 26, 2010
1 parent 752c5f5 commit 707907e
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 33 deletions.
3 changes: 2 additions & 1 deletion Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ imaginary parts of the refractive index of a given compound.
-Numerous bugfixes: an important one would be the restoration of IDL support
on Mac OS X Snow Leopard
-Creation of IDL bindings rpm
-Added Java bindings (requires Sun JAVA compiler)
-Added Java bindings (requires Sun JAVA compiler): works on Linux and Mac Os X
-Verified support on FreeBSD 8.0 64-bit

Version 2.12.1 Tom Schoonjans

Expand Down
17 changes: 9 additions & 8 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,17 @@ Platforms known to compile and run xraylib
Solaris 10 (32-bit/64-bit)
Mac OS X (32-bit/64-bit)
Windows (Cygwin, static version only)
FreeBSD (64-bit)

Not all bindings have been tested on each of these platforms. The following table summarizes the current status.

| Linux | Mac OS X | Solaris | Cygwin |
------------------------------------------------
Fortran | x | x | x | x |
Perl | x | x | x | x |
Python | x | x | | x |
IDL | x | x | | |

| Linux | Mac OS X | Solaris | Cygwin | FreeBSD |
----------------------------------------------------------
Fortran | x | x | x | x | x |
Perl | x | x | x | x | x |
Python | x | x | | x | |
IDL | x | x | | | |
Java | x | x | ? | ? | |


-----------------------------------------------
Expand Down Expand Up @@ -83,7 +84,7 @@ on the PATH. A typical PATH should include the directories
For example,

$ PATH=/opt/SUNWspro/bin:/usr/ccs/bin:/usr/ucb:$PATH
$ ./configure CC=cc CFLAGS=-O
$ ./configure CC=cc

Use gmake instead of make. To do this, invoke:

Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ if ENABLE_FORTRAN
endif


EXTRA_DIST = idl doc xraylib.spec.in xraylib.spec
EXTRA_DIST = idl doc xraylib.spec.in


6 changes: 5 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,11 @@ AM_CONDITIONAL([ENABLE_JAVA],[test x$VALID_JAVA = xyes])

#C++ example
AC_PROG_CXX
if test $CXX ; then
AC_PROG_CXXCPP
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS([cstdio cstdlib], ,[CXX=""])
AC_LANG_POP([C++])
if test x$CXX != x ; then
AC_MSG_NOTICE([C++ example enabled])
AC_SUBST(CXX)
fi
Expand Down
32 changes: 16 additions & 16 deletions example/xrlexample6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,41 +21,41 @@ int main()
//if something goes wrong, the test will end with EXIT_FAILURE
SetHardExit(1);

printf("Example of C++ program using xraylib\n");
printf("Ca K-alpha Fluorescence Line Energy: %f\n",
std::printf("Example of C++ program using xraylib\n");
std::printf("Ca K-alpha Fluorescence Line Energy: %f\n",
LineEnergy(20,KA_LINE));
printf("Fe partial photoionization cs of L3 at 6.0 keV: %f\n",CS_Photo_Partial(26,L3_SHELL,6.0));
printf("Zr L1 edge energy: %f\n",EdgeEnergy(40,L1_SHELL));
printf("Pb Lalpha XRF production cs at 20.0 keV (jump approx): %f\n",CS_FluorLine(82,LA_LINE,20.0));
printf("Pb Lalpha XRF production cs at 20.0 keV (Kissel): %f\n",CS_FluorLine_Kissel(82,LA_LINE,20.0));
printf("Bi M1N2 radiative rate: %f\n",RadRate(83,M1N2_LINE));
printf("U M3O3 Fluorescence Line Energy: %f\n",LineEnergy(92,M3O3_LINE));
std::printf("Fe partial photoionization cs of L3 at 6.0 keV: %f\n",CS_Photo_Partial(26,L3_SHELL,6.0));
std::printf("Zr L1 edge energy: %f\n",EdgeEnergy(40,L1_SHELL));
std::printf("Pb Lalpha XRF production cs at 20.0 keV (jump approx): %f\n",CS_FluorLine(82,LA_LINE,20.0));
std::printf("Pb Lalpha XRF production cs at 20.0 keV (Kissel): %f\n",CS_FluorLine_Kissel(82,LA_LINE,20.0));
std::printf("Bi M1N2 radiative rate: %f\n",RadRate(83,M1N2_LINE));
std::printf("U M3O3 Fluorescence Line Energy: %f\n",LineEnergy(92,M3O3_LINE));
//parser test for Ca(HCO3)2 (calcium bicarbonate)
struct compoundData cdtest;
if (CompoundParser("Ca(HCO3)2",&cdtest) == 0)
return 1;
int i;
printf("Ca(HCO3)2 contains %i atoms and %i elements\n",cdtest.nAtomsAll,cdtest.nElements);
std::printf("Ca(HCO3)2 contains %i atoms and %i elements\n",cdtest.nAtomsAll,cdtest.nElements);
for (i = 0 ; i < cdtest.nElements ; i++)
printf("Element %i: %lf %%\n",cdtest.Elements[i],cdtest.massFractions[i]*100.0);
std::printf("Element %i: %lf %%\n",cdtest.Elements[i],cdtest.massFractions[i]*100.0);

FREE_COMPOUND_DATA(cdtest)

//parser test for SiO2 (quartz)
if (CompoundParser("SiO2",&cdtest) == 0)
return 1;

printf("SiO2 contains %i atoms and %i elements\n",cdtest.nAtomsAll,cdtest.nElements);
std::printf("SiO2 contains %i atoms and %i elements\n",cdtest.nAtomsAll,cdtest.nElements);
for (i = 0 ; i < cdtest.nElements ; i++)
printf("Element %i: %lf %%\n",cdtest.Elements[i],cdtest.massFractions[i]*100.0);
std::printf("Element %i: %lf %%\n",cdtest.Elements[i],cdtest.massFractions[i]*100.0);

FREE_COMPOUND_DATA(cdtest)

printf("Ca(HCO3)2 Rayleigh cs at 10.0 keV: %f\n",CS_Rayl_CP("Ca(HCO3)2",10.0) );
std::printf("Ca(HCO3)2 Rayleigh cs at 10.0 keV: %f\n",CS_Rayl_CP("Ca(HCO3)2",10.0) );

printf("CS2 Refractive Index at 10.0 keV : %g - %g i\n",Refractive_Index_Re("CS2",10.0,1.261),Refractive_Index_Im("CS2",10.0,1.261));
printf("C16H14O3 Refractive Index at 1 keV : %g - %g i\n",Refractive_Index_Re("C16H14O3",1.0,1.2),Refractive_Index_Im("C16H14O3",1.0,1.2));
printf("SiO2 Refractive Index at 5 keV : %g - %g i\n",Refractive_Index_Re("SiO2",5.0,2.65),Refractive_Index_Im("SiO2",5.0,2.65));
std::printf("CS2 Refractive Index at 10.0 keV : %g - %g i\n",Refractive_Index_Re("CS2",10.0,1.261),Refractive_Index_Im("CS2",10.0,1.261));
std::printf("C16H14O3 Refractive Index at 1 keV : %g - %g i\n",Refractive_Index_Re("C16H14O3",1.0,1.2),Refractive_Index_Im("C16H14O3",1.0,1.2));
std::printf("SiO2 Refractive Index at 5 keV : %g - %g i\n",Refractive_Index_Re("SiO2",5.0,2.65),Refractive_Index_Im("SiO2",5.0,2.65));


}
Expand Down
8 changes: 6 additions & 2 deletions include/xraylib-parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,13 @@ struct compoundData {
* in a compoundData structure
*/

#define FREE_COMPOUND_DATA(cd) free(cd.Elements);\
#ifdef __cplusplus
#define FREE_COMPOUND_DATA(cd) std::free(cd.Elements);\
std::free(cd.massFractions);
#else
#define FREE_COMPOUND_DATA(cd) free(cd.Elements);\
free(cd.massFractions);

#endif
/*
* The CompoundParser function will parse a string and will put the results in
* a compoundData structure pointed to by cd. If successful, the function
Expand Down
4 changes: 3 additions & 1 deletion m4/m4-ax_prog_javah.m4
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ if test "x$ac_cv_path_JAVAH" != x ; then
if test -L $ac_cv_path_JAVAH ; then
while test -L $ac_cv_path_JAVAH
do
ac_cv_path_JAVAH=`readlink $ac_cv_path_JAVAH`
dnl ac_cv_path_JAVAH=`readlink $ac_cv_path_JAVAH`
dnl since readlink doesn't appear on all systems (I hate Solaris...), let's use an awk trick
ac_cv_path_JAVAH=`ls -l $ac_cv_path_JAVAH | awk -F\> '{print $NF}'`
done
fi
ac_save_CPPFLAGS="$CPPFLAGS"
Expand Down
2 changes: 0 additions & 2 deletions src/xraylib_idl.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,6 @@ XRL_4SFFF(DCSPb_Rayl_CP)
XRL_4SFFF(DCSPb_Compt_CP)
XRL_2SF(CS_Photo_Total_CP)
XRL_2SF(CSb_Photo_Total_CP)
XRL_3SIF(CS_Photo_Partial_CP)
XRL_3SIF(CSb_Photo_Partial_CP)
XRL_2SF(CS_Total_Kissel_CP)
XRL_2SF(CSb_Total_Kissel_CP)
XRL_3SFF(Refractive_Index_Re)
Expand Down
7 changes: 6 additions & 1 deletion xraylib.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ This rpm package provides the IDL bindings of xraylib.


%build
%configure --disable-perl FC=gfortran
%configure --disable-perl --disable-java --enable-idl --enable-fortran2003 --enable-python FC=gfortran
#necessary to fix rpath issues during rpmbuild
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool

make


Expand Down Expand Up @@ -117,6 +121,7 @@ rm -rf $RPM_BUILD_ROOT

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root)

Expand Down

0 comments on commit 707907e

Please sign in to comment.