regarding locking up file access in Gfortran - gfortran

In Intel FORTRAN I could simply write share ='denyrw' in the open statement to prevent a file from multiaccess. However in GNU FORTRAN the statement seemed not working.
What is the correct syntax to deny reading/writing of a file in FORTRAN?

share is a ifort specific specifier and is not standard. If you use this, don't expect it to be honoured by other compilers. action may be one option, but its global for the file system.
I don't think there is any specifier as such in fortran standard.
You will find the fortran standards here
So moral of the story is: either stick to standard or stick to your compiler

Related

Dart is compiled or interpreted language?

I've searched a lot on the internet about if Dart is a compiled or interpreted language, also I searched in the documentation and didn't get a clear answer about if Dart is compiled or interpreted or both, and how that works
Yes!
The concepts of "compiled language" and "interpreted language" are not well defined.
Dart is definitely compiled in some cases. Say, when compiling to JavaScript for the web. That translates the program to a program in a different language, while preserving runtime behavior, which is the definition of compilation. (So "compilation" is well defined!)
To be pedantic, languages are not inherently compiled or interpreted. Implementations of languages may compiling or interpreting.
When running Dart on the native VM, directly from source code, it looks very much interpreted. But "interpretation" is a much mushier concept than compilation.
The only thing which is fundamentally and unequivocally interpretation is executing code directly by interpreting the source code, with no intermediate representation.
Nobody does that, not since BASIC. It's just too inefficient.
These days, you at least convert the source code to an abstract syntax tree. That's technically a compilation (converts a program from one representation to another, while preserving semantics). Then you might compile to a different internal representation. Maybe to byte code. Maybe even to native code.
Sometimes you do all of these, doing just-in-time compilation to the next level when optimization calls for it.
The Dart VM compiles source code, through a number of steps, into native machine code. (Which is then interpreted by the CPU.)
Whether that counts as "interpretation" or not is really a philosophical question.
From the outside, it matches one of the definitions of interpretation ("program goes in, runtime behavior occurs", as opposed to compilation which is "program goes in, other program comes out").
Internally, the VM is very much considering itself a compiler.

Evaluating Rascal's Performance?

I want to evaluate the performance of Rascal for a given rewrite system that I've written. I'm wondering if there's a good way of doing it?
Ideally, I'd generate some compiled Java classes from the system and then run them manually against my inputs. Is there an easy or recommended way to do it?
Cheers,
One way to do this is to use the functions in the library util::Benchmark. Typically, you could write something like
cpuType( (){ call_the_function_I_want_to_observe(); } ). This will execute your function and print the cpu time used.
Note that Rascal can be executed in two ways: interpreted and compiled which makes a big difference when measuring performance. We are working hard at the moment to fully integrate the compiler in the Eclipse IDE, but a stand alone version is available as well. This can be called as java -Xss8m -jar rascal-0.8.4-SNAPSHOT.jar --compiledREPL followed by at least values for directories for sources (--src), and binaries (--bin). Here rascal-0.8.4-SNAPSHOT.jar (but most likely named differently) is downloaded from the https://update.rascal-mpl.org/console/rascal-shell-unstable.jar.
If you need more information, don't hesitate to ask for more details: this part of our tool chain is unfortunately still undocumented.

How to obtain a file with the content of all include files explicitly included?

George "Mirage" Bakhtadze, the author of Cast II engine, has wrote about an include-based technique which can be used to create generic containers and algorithms. The source is avaiable from the repo at Github. For me, his include-based technique is very interesting and useful, because it can be used for older Delphi and it is compatible between Delphi and Free Pascal (and non-Windows OS ready).
It would be more useful for me if the _GenVector written in "gen_coll_vector.inc" has Sorted & Duplicates properties and related behaviors (behaving the same way as in TStringList).
However, it is less obvious for me to insert the code when there are many include directives (I wonder how George managed this in the first place). Therefore, I wonder whether it is possible to obtain a sample file with all include files explicitly included ? It might be more straightforward for me to start from there.
I mean that there is certain built-in pre-processor that works before the actual compiling and whether there is a way to keep these intermediate files ?
Delphi does not use a pre-processor. It is (and always has been, since Turbo Pascal days) a single-pass compiler. There is no intermediate step. When you {$I} to include files, they are inserted in place in memory during the compilation process. Therefore, there is no "intermediate file" that can be kept.

PTHREAD_MUTEX_ROBUST vs PTHREAD_MUTEX_ROBUST_NP

I've written some code (to run under Linux) that uses pthread robust mutexes for deadlock recovery.
Under Centos 5 the mutex attr name is PTHREAD_MUTEX_ROBUST_NP. However under Fedora 16 the _NP suffix has been removed.
The Posix standard does not include the suffix. What does the suffix mean, when was it removed, and what is the proper way to get code to compile that uses either naming of the feature.
EDIT: So it appears that in latter pthreads the suffix was removed. However, defining _GNU_SOURCE redefines the '_np' versions so the source can compile under either.
As suggested already by cnicutar the _NP stands for non-portable and is appended by implementations that want to add functionality that is not (or not yet) in the standard. The standard will only consider including functions that are implemented in at least one major implementation and prove to be useful and not trivially achievable using existing standard functions.
Fedora generally uses more recent versions of libraries than RHEL (or CentOS) and probably removed the _np now that robust mutexes and the associated API have been accepted into the standard.

How to compile COBOL 85 program on

So here is the problem: Recently someone bought a new PC for server to replace an older dating from before 1985 (i wonder how it is possible to work daily from then) .
He wants to put there the old COBOL software and he isnt willing in any means to rewrite it to something better..
So is there any compiler for 1985 cobol? For nowadays red hat linux? Googling it found opencobol and other few but all converted the code to c... Seems too compilacted too me..
UPDATE AS REQUESTED
AIX was the old system
What's the problem with converting the COBOL to C and then compiling? As long as it works. Early C++ environments were implemented in the same way: they converted the C++ to C, and then invoked the C compiler.
Converting the COBOL to C allows them to use high-level abstractions that implement the COBOL equivalents in C. They can leverage the standard C libraries, and also convert the COBOL data access code into calls to widely available databases like MySQL. Finally, converting to C and then compiling leverages the vast amount of development effort that went into code generation. Were they to try compiling directly to object code, they'd have to generate the intermediate code expected by the GNU compiler subsystem, or they'd have to go directly to object code. Either one of those would be much more complicated than converting to C, meaning that the likelihood of bugs in the COBOL compiler would be much higher.
From where I sit, I'd say OpenCOBOL is worth looking into. Note that they say they implement "a substantial part of the COBOL 85 and COBOL 2002 standards." You probably want to make sure that they implement the parts that you need.
I would also suggest that you look into TinyCOBOL.
You don't mention when the application, or AIX was last updated. If these were updated in the last few years, you may be able to port the application, without re-compiling. You should check to see what COBOL compiler was used originally, e.g IBM, RM/COBOL, AcuCOBOL, etc. It might be possible to buy a run-time only version (will execute, but not compile), which would be cheaper than buying a compiler.
A company called Micro Focus make a cobol compiler for Windows but I can assure you it is not cheap at all!
Standard method for doing this is called migrating and involves a number of steps including converting source file to a textfile format or a filetype compatible with the target computer, using an approved method of converting to a file and writing to magtape with compatible recording method of Phase encoding or to disk or other data medium possibly in the ASN.xx mode, transferring to the new computer to then read in the file (through ASN.yy) and store it in a native or import file format, then either use a utility to convert it to the sourcefile format or by running the program development environment to access the native text file or import file and saving the content as a native sourcefile. Perform manual checks and amendments to the source or script code and then compile the program and repeat alterations until a working version is achieved. Create test data files on the new computer and create a new jobfile or macro to run the job in the development environment. When fully tested the program can be run live using data files and live macros or jobfiles migrated over from the old system or newly created in more or less the same way as bringing over the source code. An important point is that the live data must be read into a specialized data takeon or loading program to achieve a populated database before any new transactions occur in the case of a structured datafile being necessary. When moving from AIX or other versions of Unix to an entirely different operating system the characters for end of line and linefeed and end of record may need specific conversion if they are not handled by a file format convertor or exporter utility.

Resources