imesh_testF fails when pathname is too long

Issue #76 new
Jason Sarich created an issue

Found a little problem trying out spack in imoab_testF.F:  

    filename = MESHDIR2//fname

where MESHDIR2 is defined in the make command (-DMESHDIR2=/path/to/meshdir) spack uses really long names, this macro replacement makes the line too long:

-DMESHDIR2=\"/sandbox/sarich/spack/var/spack/stage/moab-tempest_new_api-ezr5t55pqpld5sz4srffqroaupl4rgvz/moab/MeshFiles/unittest\"

imoab_testF.F:92:18:

filename = MESHDIR2//fname
           1
Error: Unterminated character constant beginning at (1)

Comments (7)

  1. Iulian Grindeanu

    yes, thanks; I think the only solution is to read the name of the file at runtime; in Fortran 77, we cannot exceed 72 characters in one line, and the file name plus path will be longer than that. Is there another solution? The filename should be input to the test, and it resides in the repo. What is the best solution ? Or should we switch the test to fortran 90?

  2. Vijay M

    Ah, we have seen this before. @iulian07

    I'm unaware of how to pass command line arguments cleanly to fortran. Thoughts ? We should see if we can create a wrapper to our ProgOptions class somehow.

  3. Jason Sarich reporter

    F77 doesn't have a portable way to get arguments, each compiler can do it's own thing. Another option would be to write the pathname to a file.

  4. Iulian Grindeanu

    no, we do not have a fix, I think we will have to write file name to another file, and read it from there, to support out of source builds and bebop compiler

  5. Log in to comment