josephalevin / fson

Fortran 95 JSON Parser
60 stars 25 forks source link

please add some documentation for installation #19

Open appleparan opened 9 years ago

appleparan commented 9 years ago

I have a trouble with installation. I got following errors but there is no documentation for that. Is there a minimum requirement for gfortran? (I'm using GNU Fortran (GCC) 4.4.6 20120305) Moreover, how I link fson with my code? Using .mod and .so files or adding source to my program directly? I think adding some documentation for that kind of things will helps.

gfortran -O2 -fpic -Jbuild -c src/fson_path_m.f90 -o build/fson_path_m.o
src/fson_path_m.f90:138.132:

                                                                           1
Warning: Line truncated at (1)
src/fson_path_m.f90:658.36:

      call get_array_2d(this, path, array_callback_2d_logical)
                                    1
Error: Internal procedure 'array_callback_2d_logical' is not allowed as an actual argument at (1)
src/fson_path_m.f90:633.36:

      call get_array_2d(this, path, array_callback_2d_double)
                                    1
Error: Internal procedure 'array_callback_2d_double' is not allowed as an actual argument at (1)
src/fson_path_m.f90:608.36:

      call get_array_2d(this, path, array_callback_2d_real)
                                    1
Error: Internal procedure 'array_callback_2d_real' is not allowed as an actual argument at (1)
src/fson_path_m.f90:583.36:

      call get_array_2d(this, path, array_callback_2d_integer)
                                    1
Error: Internal procedure 'array_callback_2d_integer' is not allowed as an actual argument at (1)
src/fson_path_m.f90:499.36:

      call get_array_1d(this, path, array_callback_1d_logical)
                                    1
Error: Internal procedure 'array_callback_1d_logical' is not allowed as an actual argument at (1)
src/fson_path_m.f90:474.36:

      call get_array_1d(this, path, array_callback_1d_double)
                                    1
Error: Internal procedure 'array_callback_1d_double' is not allowed as an actual argument at (1)
src/fson_path_m.f90:449.36:

      call get_array_1d(this, path, array_callback_1d_real)
                                    1
Error: Internal procedure 'array_callback_1d_real' is not allowed as an actual argument at (1)
src/fson_path_m.f90:424.36:

      call get_array_1d(this, path, array_callback_1d_integer)
                                    1
Error: Internal procedure 'array_callback_1d_integer' is not allowed as an actual argument at (1)
make: *** [build/fson_path_m.o] Error 1
acroucher commented 9 years ago

I suspect your compiler is probably too old- gfortran 4.4.6 is quite out of date now. I am currently using 4.7.2, which compiles fson fine, but even that version is now a few years out of date. Is it possible to update your compiler?

Installation should be just a matter of typing make in the fson directory. That should give you a shared library libfson.so in the dist/ directory. You can then type make install to copy that to a more useful location e.g. ~/lib by default. It will also copy the *.mod files to an include directory, e.g. ~/include by default. Then you just need to link to that library and use those module files when you compile your own code.