Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling instruction #5

Open
happy12 opened this issue Mar 13, 2017 · 27 comments
Open

Compiling instruction #5

happy12 opened this issue Mar 13, 2017 · 27 comments

Comments

@happy12
Copy link

happy12 commented Mar 13, 2017

Can someone explain how to compile this marvel? Will it work on a PC compiled with GNU Fortran? There are no makefile nor instructions for compiling. Thanks in advance!

@AeroDME
Copy link

AeroDME commented Mar 13, 2017

It does compile with GNU Fortran (gfortran). That being said, I needed to modify a few files. Mostly the OPEN commands were non standard. Additionaly you need to set switches to turn off bounds checking, accept Hollerith notation, and implicitly apply the SAVE command.

Compiler switches I needed:
-fno-range-check -fno-automatic -std=legacy

You can check out my fork:
https://github.com/AeroDME/NASTRAN-95

The makefile is in the top level directory. It uses gfortan, and assumes that you have python in your $PATH. I did it in a linux environment, and it should work in a cygwin environment with minimal fuss.

Cheers.

@dhhudson
Copy link

dhhudson commented Mar 13, 2017 via email

@AeroDME
Copy link

AeroDME commented Mar 14, 2017

Hi Dave,

Yeah, this requires a little knowledge of compiling. You could read up on CYGWIN which is a linux environment that runs on windows. I am sure a windows fortran compiler will do it, and you can use the makefile specified prevously. But I don't know where you can get just the binaries. In fact, I am not sure the NASA license permits distribution of the binaries.

Also, make sure this is what you want. You cannot necessarily take a MSC/NX NASTRAN bulk data file and just run it. It doesn't know what SOL 101 OR NLSTATIC means. It is not modern.

Cheers.

@dhhudson
Copy link

dhhudson commented Mar 14, 2017 via email

@sylvestre
Copy link

FYI, this is packaged in Debian:
https://packages.debian.org/sid/nastran

And the sources contain a autotools build system: https://github.com/ldallolio/NASTRAN-95 by @ldallolio

@mbrethen
Copy link

I was able to build twuerfl/NASTRAN-95 on mac os 10.12 but it segfaults when I run one of the test input files.

==== NASTRAN is beginning execution of bar ====

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x16746bf8f
#1  0x16746b772
#2  0x7fffb1879b39
#3  0x1079eb44f
#4  0x1079eb232
#5  0x1079e5fea
#6  0x1078d4273
#7  0x1079fb9c4
#8  0x1077f997f
#9  0x107a13b1d
Segmentation fault

So I think I will give yours a try. Do you think it will work?

@AeroDME
Copy link

AeroDME commented Dec 19, 2018 via email

@mbrethen
Copy link

I intend to install everything into /opt/local/... I'm aware that the nastran executable has hardcoded paths, e.g. set rfdir=/usr/users/bob/nast95/rf and I'll need to patch these. What is the expected directory tree layout?

Thanks

@AeroDME
Copy link

AeroDME commented Dec 20, 2018 via email

@mbrethen
Copy link

I didn't recognize the string replacement at first. I had to look at my python reference to see that you're using string replacement with explicit numbering (I'm used to %(foo)s ), setting RFDIR = nastran_home/rf. nastran_home is set to the absolute path where sbin/nastran.py resides.

@mbrethen
Copy link

I tried to build it this morning without success. Asside from several warnings of the type:

Warning: Array reference at (1) out of bounds (97 > 1) in loop beginning at (2)

It returned with an error:

:info:build /opt/local/bin/gfortran-mp-8 -g -fno-range-check -fno-automatic -std=legacy -Iinclude -Llib -Jobj obj/nastrn.o -lnas -o bin/nastran.x    # Note that "-lnas" is after "obj/nastrn.o"!
:info:build ld: warning: ignoring file lib/libnas.a, file was built for archive which is not the architecture being linked (x86_64): lib/libnas.a
:info:build Undefined symbols for architecture x86_64:
:info:build   "_btstrp_", referenced from:
:info:build       _MAIN__ in nastrn.o
:info:build   "_dbmint_", referenced from:
:info:build       _MAIN__ in nastrn.o
:info:build   "_locfx_", referenced from:
:info:build       _MAIN__ in nastrn.o
:info:build   "_mesage_", referenced from:
:info:build       _MAIN__ in nastrn.o
:info:build   "_waltim_", referenced from:
:info:build       _MAIN__ in nastrn.o
:info:build   "_xsem00_", referenced from:
:info:build       _MAIN__ in nastrn.o
:info:build ld: symbol(s) not found for architecture x86_64
:info:build collect2: error: ld returned 1 exit status
:info:build make: *** [bin/nastran.x] Error 1

This usually means that libnas.a is compiled for 32-bit, but the rest of the project is compiled for 64-bit.

@sylvestre
Copy link

If you want to build the Debian/Ubuntu package, the method is super easy
$ sudo apt-get build-dep nastran
$ apt-get source nastran
$ cd nastran-*
$ dpkg-buildpackage -nc -b

@mbrethen
Copy link

mbrethen commented Dec 22, 2018

According to this discussion I patched the makefile and used libtool to get it to compile.

So, after building I end up with:

lrwxr-xr-x     1 macports  admin        11 Dec 22 16:23 COSDBCL -> alt/COSDBCL
lrwxr-xr-x     1 macports  admin        11 Dec 22 16:23 COSDDAM -> alt/COSDDAM
lrwxr-xr-x     1 macports  admin        11 Dec 22 16:23 COSDFVA -> alt/COSDFVA
lrwxr-xr-x     1 macports  admin        11 Dec 22 16:23 COSHYD1 -> alt/COSHYD1
lrwxr-xr-x     1 macports  admin        11 Dec 22 16:23 COSHYD2 -> alt/COSHYD2
lrwxr-xr-x     1 macports  admin        11 Dec 22 16:23 COSMFVA -> alt/COSMFVA
-rw-r--r--     1 macports  admin     49152 Mar 13  2017 NASA Open Source Agreement-NASTRAN 95.doc
-rw-r--r--     1 macports  admin     16891 Dec 22 16:23 NASINFO
-rw-r--r--     1 macports  admin  63670639 Mar 13  2017 NASTRAN Programmers Manual.pdf
-rw-r--r--     1 macports  admin  13989025 Mar 13  2017 NASTRAN Users Manual 2.pdf
drwxr-xr-x  1057 macports  admin     35938 Dec 22 16:23 OUTPUT
-rw-r--r--     1 macports  admin       859 Mar 13  2017 README.md
lrwxr-xr-x     1 macports  admin        19 Dec 22 16:23 RSCARDS -> OUTPUT/t04021a.dict
drwxr-xr-x     8 macports  admin       272 Mar 13  2017 alt
drwxr-xr-x    42 macports  admin      1428 Mar 13  2017 bd
drwxr-xr-x    23 macports  admin       782 Dec 22 16:23 bin
drwxr-xr-x   134 macports  admin      4556 Mar 13  2017 demoout
drwxr-xr-x    10 macports  admin       340 Mar 13  2017 include
drwxr-xr-x   219 macports  admin      7446 Mar 13  2017 inp
drwxr-xr-x     6 macports  admin       204 Dec 22 16:23 lib
-rw-r--r--     1 macports  admin      7060 Dec 22 16:20 makefile
drwxr-xr-x   115 macports  admin      3910 Mar 13  2017 mds
drwxr-xr-x  1652 macports  admin     56168 Mar 13  2017 mis
drwxr-xr-x  1810 macports  admin     61540 Dec 22 16:23 obj
drwxr-xr-x    41 macports  admin      1394 Mar 13  2017 obsolete
drwxr-xr-x    29 macports  admin       986 Mar 13  2017 rf
drwxr-xr-x     5 macports  admin       170 Mar 13  2017 sbin
drwxr-xr-x     7 macports  admin       238 Mar 13  2017 src
drwxr-xr-x    13 macports  admin       442 Mar 13  2017 um

It appears the OUTPUT directory contains test runs. Looking at one of the f06 files:

0*** SYSTEM FATAL MESSAGE, RFOPEN CAN NOT OPEN /opt/local/var/macports/build/_Users_marbre_
0*** SYSTEM FATAL MESSAGE. RFCLSE/RFOPEN ERROR.  LU =   0

I guess this is because I'm building in /opt/local/... whereas the user accounts are in /Users/... on macs?

@mbrethen
Copy link

mbrethen commented Dec 24, 2018

For the moment, I have installed these directories in /opt/local/libexec/NASTRAN-95:

drwxr-xr-x  23 root  admin  782 Dec 23 18:07 bin
drwxr-xr-x  10 root  admin  340 Dec 23 18:07 include
drwxr-xr-x   6 root  admin  204 Dec 23 18:07 lib
drwxr-xr-x  29 root  admin  986 Dec 23 18:07 rf
drwxr-xr-x   5 root  admin  170 Dec 23 18:07 sbin

I've set nastran_home to this directory and created a symlink to sbin/nastran.py in /opt/local/bin, which is in my PATH.

I ran a simple bar input file and the f06 indicated it finished successfully.

bin/nasthelp.x won't load the .TXT files (says they don't exist). The text files are in the bin directory.

Have you used nastplot.x, chkfil.x or ff.x?

What are the fortran files in the obsolete folder?

@harryschaeffer
Copy link

Building nastran-95 is not for the faint of heart; and at the end of the day, assuming you are persistent, you will end up with a obsolete code. That being said I have had success using CODE BLOCKS with ubuntu linux 18.04. ( Ubuntu can also be run in Win 10.) I created several fortran library projects as well as the main application finally produced a running executable.

The biggest plus is that it incorprates the DMAP compiler and runs the example problems that come with the release. The element library and the solvers are woefully obsolete: it represents 30 year old technology. However, if you have the time and expertise you can use what I call the NOS (Nastran Operating System) to create a modern up-to-date system. Think of combining JuliaFEM element modules in a rather elegant nastran system.

I don't want to get bogged down with raising 95 from the library of dead codes but would be happy to respond to requests from those in academia and consultants like Dave for a copy of my code that I call CML (Computational Mechanics Laboratory). I believe you will be impressed with it. Contact me if you are interested.

@dhhudson
Copy link

dhhudson commented Aug 20, 2019 via email

@harryschaeffer
Copy link

harryschaeffer commented Aug 28, 2019 via email

@diegomagela
Copy link

Hello all.

Can someone help me to compile that or have a compiled example to follow? I'm on Ubuntu.
For example:

  1. Do that
  2. Than do that
  3. ...
    .
    .
    .
    N. Finsh

@harryschaeffer
Copy link

harryschaeffer commented Apr 4, 2020 via email

@harryschaeffer
Copy link

harryschaeffer commented Apr 6, 2020 via email

@harryschaeffer
Copy link

harryschaeffer commented Apr 6, 2020 via email

@Foadsf
Copy link

Foadsf commented May 10, 2020

Hello everybody,

We have some of the MYSTRAN, pyNASTRAN , and FreeCAD folks at the NASTRAN Discord channel working to get this going. It would be great to have you over there as well. let's see if we can revive this initiative.

@Foadsf
Copy link

Foadsf commented Mar 10, 2021

For those who end up here looking for ComLab, @harryschaeffer has now released ComLab as a freemium software. More information here

https://www.mystran.com/forums/showthread.php?tid=58

@dev-zch
Copy link

dev-zch commented Nov 27, 2022

I make a dir called opt under /home, with copying nastran-95-master,and building it ,and I success,but when I test the job d010000a.inp I get a fatal " RFOPEN CAN NOT OPEN /public1/home/sc91522/opt/NASTRAN-95-master/", can anyone help me recorrect this issue? added that my system is contos 7.9 x64

@dev-zch
Copy link

dev-zch commented Nov 27, 2022

Do u mean that I must build it under the root dir ?

@woodifsh
Copy link

woodifsh commented Jul 9, 2024

It does compile with GNU Fortran (gfortran). That being said, I needed to modify a few files. Mostly the OPEN commands were non standard. Additionaly you need to set switches to turn off bounds checking, accept Hollerith notation, and implicitly apply the SAVE command.

Compiler switches I needed:
-fno-range-check -fno-automatic -std=legacy

You can check out my fork:
https://github.com/AeroDME/NASTRAN-95

The makefile is in the top level directory. It uses gfortan, and assumes that you have python in your $PATH. I did it in a linux environment, and it should work in a cygwin environment with minimal fuss.

Cheers.

It seems that 'SMCOMX.COM' and 'MMACOM.COM' are necessary files in the 'mis' folder, but these two files are missing in the current version.

@dev-zch
Copy link

dev-zch commented Jul 9, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants