{"id":186,"date":"2009-04-01T17:28:09","date_gmt":"2009-04-01T21:28:09","guid":{"rendered":"http:\/\/www.partofthething.com\/thoughts\/?p=186"},"modified":"2009-04-01T17:28:09","modified_gmt":"2009-04-01T21:28:09","slug":"installing-mc2-and-dif3d-in-linux-or-windows","status":"publish","type":"post","link":"https:\/\/partofthething.com\/thoughts\/installing-mc2-and-dif3d-in-linux-or-windows\/","title":{"rendered":"compiling and installing MC**2 and dif3d in linux or windows"},"content":{"rendered":"<p>I thought the search engines were lacking in this topic that I have some experience in, so I figured I better do my part. I have installed <a href=\"http:\/\/www-rsicc.ornl.gov\/codes\/psr\/psr3\/psr-350.html\">MC**2-2<\/a> on a windows computer and on a linux computer using similar methods. The XS libraries I obtained differed from the results from my SPARC machine in the later decimal places, and global calculations were nearly identical. I haven&#8217;t tested all features, but it seems to work. I&#8217;ve also been running <a href=\"http:\/\/www-rsicc.ornl.gov\/codes\/ccc\/ccc6\/ccc-653.html\">DIF3D 8.0<\/a> on my Ubuntu machine through a very ridiculous method. It runs in windows under <a href=\"http:\/\/www.cygwin.com\/\">Cygwin<\/a> nicely.<\/p>\n<p><strong>MC**2-2 on a modern computer<\/strong><\/p>\n<p>MC**2 is a nice lattice physics code mostly used for fast reactors. It uses ENDF-V data and has excellent treatment of the unresolved resonances and stuff. According to my friends at Argonne National Lab, MC**2-3 is coming out soon, and it will compile easily on PCs. That&#8217;ll be nice, and it will make this discussion irrelevant. It&#8217;s going through verification right now. Anyway, until then, here&#8217;s the general idea. Get VMWare server and install Solaris 10 for i386 on it. This comes with the f77 compiler that MC**2 can actually use. Once you have that all installed, go in there and extract the MC**2 source. Edit the mcc.f file. Make these code changes:<\/p>\n<ol>\n<li>on line 12029 change REAL*16 to REAL*8. x86 architectures don&#8217;t support quad precision<\/li>\n<li>on lines 32858 and 32859, do the same.<\/li>\n<li>starting on line 32900, uncomment the lines with DEXP and DLOC and comment out QLOG and DLOG for a total of 4 changes ( 2 uncomments, 2 comments).<\/li>\n<li>Same on line 32937, but only one swap this time.<\/li>\n<li>Add an extra space before the text on line 44534. This is some error in the RSICC distribution.<\/li>\n<\/ol>\n<p>I&#8217;ve done this on Solaris 10 with great success, and now I&#8217;m trying it out on OpenSolaris, on my new external hard drive. I had to give it 1GB of RAM or it was crazy slow. OK it works in opensolaris too. Here are the steps:<\/p>\n<ol>\n<li>gunzip and untar p350tar1.gz<\/li>\n<li>edit exec_compile.mcc.sun script and change the lib and jobdir variables to where ever.<\/li>\n<li>make the code changes to mcc.f as discussed<\/li>\n<li>run a copy of the script with the uncompress and copies commented out so it doesn&#8217;t overwrite your changes (I did this a few times)<\/li>\n<\/ol>\n<p>I had to turn optimization in the script from O3 to O2, or else I got a core dump on compiling mcc. f. If all goes well, you should have the MC2 executable.<\/p>\n<p>Now you have to make the libraries. The code to convert libraries needs similar code changes. Change All REAL*16 s to REAL*8, the QLOG to DLOG, and the QEXP to DEXP. It will compile now. I added the cwd to my path and the script ran nicely. Notice that when you change the code, you can&#8217;t just re-run the script as is because it uncompresses the original files each time. I made a copy of the script and commented out all the uncompresses after running it the 1st time.<\/p>\n<p>My last pitfall was that there was a write-protected ISOTXS file in the directory I was trying to run in and MC2 dumped the core on execution. I deleted this file and reran with wonderful success.<\/p>\n<p>I witnessed one of the guys who lead the development team of Windows 3.1 try to compile MC**2 once with the intel ifort compiler. He got it compiled, but it failed at runtime with memory allocation errors. That&#8217;s the story of my life.<\/p>\n<p><strong>DIF3D8 on a modern PC<\/strong><\/p>\n<p>DIF3D 8.0 compiles with G95. I followed instructions I found <a href=\"http:\/\/corephysics.com\/dif3d_g95.html\">here<\/a> to do it. I did run into a problem, however, with memory allocation when running on Linux. In Windows XP, under Cygwin, the instructions work perfectly. I am able to run in Linux by using the Cygwin-compiled executable through WINE. This is, conceptually, extremely ridiculous as it is using an emulator to run a program which is emulating the platform that I&#8217;m on. Go figure. The bottom line is that it works and it runs quite quickly &#8212; moreso than on the ancient solaris machines I used to run on. I think it should be quite easy to get it working natively on linux using G95 with a little effort, so let me know if you figure it out.<\/p>\n<p><strong>Cross section libraries<\/strong><\/p>\n<p>When transfering XS libraries from one machine to another, it is important to do so in ASCII, or BCD (binary coded decimal) mode. When I run MC**2, I get a binary ISOTXS file that will not transfer nicely to other computers. I use a utility to convert this to ISOBCD, which I then convert back to ISOTXS on the computer I&#8217;d like to run on.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I thought the search engines were lacking in this topic that I have some experience in, so I figured I better do my part. I have installed MC**2-2 on a windows computer and on a linux computer using similar methods. The XS libraries I obtained differed from the results from my SPARC machine in the &hellip; <a href=\"https:\/\/partofthething.com\/thoughts\/installing-mc2-and-dif3d-in-linux-or-windows\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">compiling and installing MC**2 and dif3d in linux or windows<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[5],"tags":[],"class_list":["post-186","post","type-post","status-publish","format-standard","hentry","category-nuclear"],"_links":{"self":[{"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/posts\/186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/comments?post=186"}],"version-history":[{"count":0,"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/posts\/186\/revisions"}],"wp:attachment":[{"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/media?parent=186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/categories?post=186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/partofthething.com\/thoughts\/wp-json\/wp\/v2\/tags?post=186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}