<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Approximatrix Forums — Missing C header files in mixed Fortran and C project]]></title>
	<link rel="self" href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=755&amp;type=atom" />
	<updated>2020-06-12T11:40:22Z</updated>
	<generator>PunBB</generator>
	<id>https://forums.approximatrix.com/viewtopic.php?id=755</id>
		<entry>
			<title type="html"><![CDATA[Re: Missing C header files in mixed Fortran and C project]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3504#p3504" />
			<content type="html"><![CDATA[<p>The header files you&#039;re unable to include are normally used for external process control and interprocess communication (See <a href="https://en.wikipedia.org/wiki/C_POSIX_library">Wikipedia</a>).&nbsp; I wouldn&#039;t think it would be necessary to decode a file.&nbsp; Furthermore, if a constant were used from those files, the compiler would have failed because it would have hit an &quot;undefined&quot; value somewhere along the way.&nbsp; There&#039;s a possibility, though, that a constant in one of those files is the same as something the Windows API provides such that there isn&#039;t a compilation error, but that seems unlikely. </p><p>If the program compiles, I think your best bet would be to debug it to determine why exactly it reports it is not a BUFR file.&nbsp; Just some quick googling suggest that an NOAA codebase with a file named <em>decodebufr.f</em> relies on certain environment variables to locate files.&nbsp; Do you know if that error message is printed if it can&#039;t find a file? It could be so generic that, if it cannot find a file because an environment variable is set up, it just reports that it isn&#039;t a BUFR file rather than saying the file doesn&#039;t exist.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2020-06-12T11:40:22Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3504#p3504</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Missing C header files in mixed Fortran and C project]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3501#p3501" />
			<content type="html"><![CDATA[<p>There were no warnings other than the missing headers.&nbsp; Since I commented them out, apparently some variables ended up with some value other than what was needed from those headers and did not cause a compilation error.&nbsp; The program unpacks a file in an internationally used meteorological binary format known as BUFR.&nbsp; By not working, the program errors with a message that the file is not a BUFR file.&nbsp; There was no Linux makefile.&nbsp; In Linux each C or F77 file was compiled with minor command line switches:</p><p>gcc -DUNDERSCORE -DLINUX -c &lt;filename.c&gt;<br />gfortran -fno-second-underscore -c &lt;filename.f&gt;</p><p>Finally, the main F77 file was compiled with:</p><p>gfortran -fno-second-underscore -o decodebufr decodebufr.f *.o</p><p>Googling seems to indicate a relationship/dependence between sys/ipc.h and sys/msg.h.&nbsp; So it seems like I&#039;m going to have to try to identify the variable(s) and what value(s) are expected.&nbsp; Ugh!</p>]]></content>
			<author>
				<name><![CDATA[wxmanphil]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3920</uri>
			</author>
			<updated>2020-06-12T04:46:58Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3501#p3501</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Missing C header files in mixed Fortran and C project]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3500#p3500" />
			<content type="html"><![CDATA[<p>Those headers are related to the POSIX API, so, no, they aren&#039;t available in Windows.&nbsp; However, because your project did actually compile, it would appear that they&#039;re also unnecessary.&nbsp; The compilation would have failed if those headers had contained a constant, structure, or API call that your program used on Windows.</p><p>Your program not working is a different matter.&nbsp; It could be all sorts of issues.&nbsp; Do you receive any warnings during the build?&nbsp; What exactly do you mean by &quot;does not work properly?&quot;&nbsp; </p><p>Often times with Fortran code that is somewhat older, there may have been assumptions when writing the code about how Fortran works that are incorrect.&nbsp; For example, a common assumption in older code is that all variables initialize to zero, which definitely is not the case.&nbsp; On Linux, though, a compiler flag might have been set to actually enable this behavior (<em>-finit-local-zero</em>).&nbsp; Do you have a Makefile with this code that you could check for some additional compiler flags?&nbsp; You may have to enter those into Project Options in Simply Fortran as well.</p>]]></content>
			<author>
				<name><![CDATA[jeff]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=2</uri>
			</author>
			<updated>2020-06-10T11:28:07Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3500#p3500</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Missing C header files in mixed Fortran and C project]]></title>
			<link rel="alternate" href="https://forums.approximatrix.com/viewtopic.php?pid=3499#p3499" />
			<content type="html"><![CDATA[<p>I am moving a mixed Fortran 77 and C program from Linux (gfortran and cc) to Windows (27 .f files and 18 .c files).&nbsp; Sixteen of the C files include a common header file which contains almost 2 dozen C headers.&nbsp; However, 3 headers are not found which is the only compilation error.&nbsp; They are</p><p>#include &lt;sys/ipc.h&gt;<br />#include &lt;sys/msg.h&gt;<br />#include &lt;sys/wait.h&gt;</p><p>My assumption is that there is no corresponding Windows equivalent.&nbsp; If I comment out the 3 headers, the program compiles without error but does not work properly.&nbsp; So apparently there is something in 1 or more of the 3 headers that is required but otherwise not flagged during compilation.&nbsp; I am not the original author.&nbsp; Any help with this issue is appreciated.</p><p>Thanks!</p><p>BTW, This is my first Simply Fortran project so this may be a noob error.</p>]]></content>
			<author>
				<name><![CDATA[wxmanphil]]></name>
				<uri>https://forums.approximatrix.com/profile.php?id=3920</uri>
			</author>
			<updated>2020-06-10T02:47:45Z</updated>
			<id>https://forums.approximatrix.com/viewtopic.php?pid=3499#p3499</id>
		</entry>
</feed>
