From D.Champion at rl.ac.uk Tue Jan 6 17:21:45 2004 From: D.Champion at rl.ac.uk (Champion, JDM (Dickon) ) Date: Tue, 06 Jan 2004 16:21:45 +0000 Subject: [neutron-mc] REMINDER ***Joint VITESS and McStas Training Course and Workshop* ** Message-ID: <37CAC51AC5C1D211966100A0C9ED000A035D6F00@exchange07.rl.ac.uk> Joint VITESS and McStas Training Course and Workshop 5th - 6th February 2004, ISIS Facility Motivation: In the last years, Monte Carlo simulations have proven to be a very essential and frequently implemented tool in the optimization of existing instruments and design of neutron scattering instrumentation for new facilities. Free open source and user friendly software packages such as McStas and VITESS have become available in recent years, and since then they provide an important aid for the developers of neutron instruments. This workshop is dedicated to introduce scientists to MC simulations of neutron instruments and experiments. Programming skills are welcome but not necessary. Programme: The workshop will be organized as follows: Morning sessions with talks about simulation results in general. Afternoons with simulation training courses in groups with McStas and VITESS. The final program will be decided and announced in the beginning of January. Talks: For the morning sessions, we kindly invite you to give presentations on Monte Carlo simulation results and about your experience with simulation software packages. Talks on results obtained by other packages than VITESS and McStas are also very welcome. Registration There is no workshop fee, and travel and local expenses would need to be covered by the participants. Please e-mail your intention of participation to the local organiser, Dr Dickon Champion (d.champion at rl.ac.uk) as soon as possible, with a final deadline of 10 January 2004, otherwise accommodation will be more difficult to arrange. Please let us know whether you wish to give a talk and the title of your talk. Please also show your intention for accommodation. The accommodation will be at Cosener's House in Abingdon with a cost of ?48 pounds per night (bed and breakfast). A workshop website will be soon available at: http://www.isis.rl.ac.uk/computing/Workshop.htm We are looking forward to seeing you at ISIS. Best wishes, The Organizers From peter.willendrup at risoe.dk Mon Jan 12 11:29:23 2004 From: peter.willendrup at risoe.dk (Peter Willendrup) Date: Mon, 12 Jan 2004 11:29:23 +0100 (CET) Subject: [neutron-mc] SPIE conference, august 2-6 Message-ID: Hello everyone, This is just to remind you of the SPIE conference in Denver: ************************************************************************ ADVANCES IN COMPUTATIONAL METHODS FOR X-RAY AND NEUTRON OPTICS (AM304) 2-6 August 2004, Denver, USA http://spie.org/conferences/calls/04/am/ ************************************************************************ - An excellent opportunity to share your results and experiences with other users. The URL below can be used to submit an abstract to the conference: http://www.spie.org/Conferences/Calls/04/am/submitAbstract/index.cfm?fuseaction=AM304 Regards, The McStas team -- ------------------------------------- Peter Kjaer Willendrup, cand. scient Phone: (+45) 46 77 58 62 email: peter.willendrup at risoe.dk If your messages to me are rejected take a look at: ------------------------------------- From peter.willendrup at risoe.dk Tue Jan 27 10:22:42 2004 From: peter.willendrup at risoe.dk (Peter Kjaer Willendrup) Date: Tue, 27 Jan 2004 10:22:42 +0100 (CET) Subject: [neutron-mc] 2nd Neutrons & Numerical Methods Workshop (fwd) Message-ID: Hello Everyone, The workshop below is probably of interest to some of you? Regards, Peter -- ------------------------------------- Peter Kjaer Willendrup, Cand. Scient Phone: (+45) 46 77 58 62 email: peter.willendrup at risoe.dk ------------------------------------- ---------- Forwarded message ---------- Date: Tue, 27 Jan 2004 09:37:15 +0100 From: n2m2 Subject: 2nd Neutrons & Numerical Methods Workshop Dear Colleague, We would like to draw your attention to the 2nd Neutrons and Numerical Modelling Workshop, which will be held at the Institut Laue-Langevin, Grenoble, France in September (15-18) this year. The workshop will be preceded by a one-day school that is intended not only for students, but anybody who wishes to become familiar with the basic methodologies. For further information, consult the website (www.ill.fr/Events/N2M2) or contact the organisers directly via e-mail (n2m2 at ill.fr). If you think you are interested in attending the workshop and/or the school, please fill in the WEB pre-registration form. This will allow us to gauge numbers of potential participants, to ensure that you are contacted about final registration and, generally, to keep you informed. We look forward to seeing you at ILL in September 2004, Workshop Neutrons and Numerical Methods 2 Organisers: M. Johnson, M. Gonzalez, D. Kearley, T. Mounir Workshop Secretaries: A. Mader, I. Volino Institut Laue-Langevin, B.P. 156, F-38042 Grenoble, France Tel.: +33 (0)4 76.20.75.25, Fax: +33 (0)4.76.20.76.88, E-mail: n2m2 at ill.fr http://www.ill.fr/Events/N2M2 From peter.willendrup at risoe.dk Sat Jan 31 13:37:27 2004 From: peter.willendrup at risoe.dk (Peter Willendrup) Date: Sat, 31 Jan 2004 13:37:27 +0100 (CET) Subject: [neutron-mc] Test message - please ignore Message-ID: -- ------------------------------------- Peter Kjaer Willendrup, cand. scient Phone: (+45) 46 77 58 62 email: peter.willendrup at risoe.dk If your messages to me are rejected take a look at: ------------------------------------- From peter.willendrup at risoe.dk Sat Jan 31 13:48:49 2004 From: peter.willendrup at risoe.dk (Peter Willendrup) Date: Sat, 31 Jan 2004 13:48:49 +0100 (CET) Subject: [neutron-mc] Test again, sorry. Message-ID: -- ------------------------------------- Peter Kjaer Willendrup, cand. scient Phone: (+45) 46 77 58 62 email: peter.willendrup at risoe.dk If your messages to me are rejected take a look at: ------------------------------------- From peter.willendrup at risoe.dk Thu Jan 29 14:48:53 2004 From: peter.willendrup at risoe.dk (Peter Willendrup) Date: Thu, 29 Jan 2004 14:48:53 +0100 (CET) Subject: [neutron-mc] Website/mailinglist problems Message-ID: Hi Everyone, Yesterday, the IT department here at Ris? decided to upgrade the operating system of the server running the McStas website and mailinglist... Unfortunately, they forgot that I was running these services on the machine, which put McStas 'offline' for approximately 24 hours - sorry about that. Everything should be back to normal now. If this is not the case, please inform me immediately! Regards, Peter -- ------------------------------------- Peter Kjaer Willendrup, cand. scient Phone: (+45) 46 77 58 62 email: peter.willendrup at risoe.dk If your messages to me are rejected take a look at: ------------------------------------- From peter.willendrup at risoe.dk Thu Jan 29 15:03:04 2004 From: peter.willendrup at risoe.dk (Peter Willendrup) Date: Thu, 29 Jan 2004 15:03:04 +0100 (CET) Subject: [neutron-mc] test message - please ignore. Message-ID: -- ------------------------------------- Peter Kjaer Willendrup, cand. scient Phone: (+45) 46 77 58 62 email: peter.willendrup at risoe.dk If your messages to me are rejected take a look at: ------------------------------------- From peter.willendrup at risoe.dk Thu Jan 29 17:07:45 2004 From: peter.willendrup at risoe.dk (Peter Willendrup) Date: Thu, 29 Jan 2004 17:07:45 +0100 (CET) Subject: [neutron-mc] Test again? Message-ID: -- ------------------------------------- Peter Kjaer Willendrup, cand. scient Phone: (+45) 46 77 58 62 email: peter.willendrup at risoe.dk If your messages to me are rejected take a look at: ------------------------------------- From peter.willendrup at risoe.dk Thu Jan 29 14:48:53 2004 From: peter.willendrup at risoe.dk (Peter Willendrup) Date: Thu, 29 Jan 2004 14:48:53 +0100 (CET) Subject: [neutron-mc] Website/mailinglist problems Message-ID: Hi Everyone, Yesterday, the IT department here at Ris? decided to upgrade the operating system of the server running the McStas website and mailinglist... Unfortunately, they forgot that I was running these services on the machine, which put McStas 'offline' for approximately 24 hours - sorry about that. Everything should be back to normal now. If this is not the case, please inform me immediately! Regards, Peter -- ------------------------------------- Peter Kjaer Willendrup, cand. scient Phone: (+45) 46 77 58 62 email: peter.willendrup at risoe.dk If your messages to me are rejected take a look at: ------------------------------------- From peter.willendrup at risoe.dk Mon Feb 2 16:28:44 2004 From: peter.willendrup at risoe.dk (Peter Willendrup) Date: Mon, 02 Feb 2004 16:28:44 +0100 (CET) Subject: [neutron-mc] Yet another test, sorry Message-ID: -- ------------------------------------- Peter Kjaer Willendrup, cand. scient Phone: (+45) 46 77 58 62 email: peter.willendrup at risoe.dk If your messages to me are rejected take a look at: ------------------------------------- From peter.willendrup at risoe.dk Tue Feb 10 11:06:12 2004 From: peter.willendrup at risoe.dk (Peter Willendrup) Date: Tue, 10 Feb 2004 11:06:12 +0100 (CET) Subject: [neutron-mc] Test message, please ignore Message-ID: -- ------------------------------------- Peter Kjaer Willendrup, cand. scient Phone: (+45) 46 77 58 62 email: peter.willendrup at risoe.dk If your messages to me are rejected take a look at: ------------------------------------- From peter.willendrup at risoe.dk Tue Feb 10 15:27:53 2004 From: peter.willendrup at risoe.dk (Peter Willendrup) Date: Tue, 10 Feb 2004 15:27:53 +0100 (CET) Subject: [neutron-mc] News + McStas mailinglist back in action Message-ID: Hello everyone, It seems that the McStas mailing list is functioning again! Now for some news: Vitess/McStas workshop: As you may have noticed, a joint Vitess and McStas workshop was held last week at ISIS. The full McStas team participated, and the workshop was a real success! Thanks to Dickon Champion for organising. Next release: A beta version of the next McStas release was tested at the workshop. The official release date of the 1.8 release is yet unknown, but expected within a few weeks. Regards, Peter -- ------------------------------------- Peter Kjaer Willendrup, cand. scient Phone: (+45) 46 77 58 62 email: peter.willendrup at risoe.dk If your messages to me are rejected take a look at: ------------------------------------- From Timur.Elzhov at jinr.ru Fri Feb 13 16:11:48 2004 From: Timur.Elzhov at jinr.ru (Timur Elzhov) Date: Fri, 13 Feb 2004 18:11:48 +0300 Subject: [neutron-mc] Flux and Intensity Message-ID: <20040213151148.GA30435@nf034.jinr.ru> Dear McStas experts! I have a spectra (a histogram) from the real source and want to build my own source component based on that histogram. I looked through the existing components like 'Source_Maxwell' and did it. One question remained: what the normalizing multiplier should be chosen? At first I tested the following instrument: 'Source_flux' with radius = 0.01m/sqrt(PI) (so square = 1cm^2), and with target = 1e-4m (so very close to the source). Plus Monitor with square of (0.01x0.01)m^2 was placed at 1e-4m from the source too. Initial flux was 1e+13. But sum of Intensities from each Monitor bin was 1.9e+14! But I'd like to get exactly the same flux on the monitor! :) Where am I wrong? Energy range on the source as well as on Monitor was the same, of course. Thanks a lot. -- WBR, Timur From kim.lefmann at risoe.dk Mon Feb 16 11:44:39 2004 From: kim.lefmann at risoe.dk (Kim Lefmann) Date: Mon, 16 Feb 2004 11:44:39 +0100 (CET) Subject: [neutron-mc] Flux and Intensity In-Reply-To: <20040213151148.GA30435@nf034.jinr.ru> Message-ID: Dear Timur, Notice that the units of flux is "n/(sec cm^2 AA)" Hence, the number of neutrons you detect will depend on the wavelength window. Further, the source uses "targeting" into a square area, e.g. the opening of a guide. So your beam monitor should have dimensions so that it is within the target beam, otherwise you will get "wrong" results. Try e.g. to set the target distance and size equal that of the monitor. I do not know if this solves your problem, otherwise please send me your instrument file. all the best, Kim ------------------------------ Kim Lefmann Senior Scientist Materials Research Department Building 227 Risoe National Laboratory Phone: +45 46 77 47 26 Fax: +45 46 77 57 58 On Fri, 13 Feb 2004, Timur Elzhov wrote: > Dear McStas experts! > > I have a spectra (a histogram) from the real source and want to build > my own source component based on that histogram. I looked through the > existing components like 'Source_Maxwell' and did it. One question > remained: what the normalizing multiplier should be chosen? At first I tested > the following instrument: 'Source_flux' with radius = 0.01m/sqrt(PI) > (so square = 1cm^2), and with target = 1e-4m (so very close to the source). > Plus Monitor with square of (0.01x0.01)m^2 was placed at 1e-4m from the source > too. Initial flux was 1e+13. But sum of Intensities from each Monitor bin > was 1.9e+14! But I'd like to get exactly the same flux on the monitor! :) > Where am I wrong? > Energy range on the source as well as on Monitor was the same, of course. > > Thanks a lot. > > -- > WBR, > Timur > > _______________________________________________ > neutron-mc mailing list > neutron-mc at neutron.risoe.dk > http://neutron.risoe.dk/mailman/listinfo/neutron-mc > From peter.willendrup at risoe.dk Fri Mar 5 22:16:07 2004 From: peter.willendrup at risoe.dk (Peter Willendrup) Date: Fri, 05 Mar 2004 22:16:07 +0100 (CET) Subject: [neutron-mc] McStas 1.8 is out! Message-ID: Hello everyone, We are very happy to announce that the new release, mcstas-1.8 is now available at the usual download page http://mcstas.risoe.dk/downloads Also, read the newsflash on the front webpage http://mcstas.risoe.dk - including a link to the list of added features plus acknowledgements to people who invested work in the new release. Regards from the McStas team: Peter Willendrup / Emmanuel Farhi / Kim Lefmann -- ------------------------------------- Peter Kjaer Willendrup, cand. scient Phone: (+45) 46 77 58 62 email: peter.willendrup at risoe.dk If your messages to me are rejected take a look at: ------------------------------------- From kn at sifira.dk Sat Mar 6 07:46:50 2004 From: kn at sifira.dk (Kristian Nielsen) Date: Sat, 06 Mar 2004 07:46:50 +0100 Subject: [neutron-mc] McStas 1.8 is out! In-Reply-To: References: Message-ID: <7swu5yxyjp.fsf@ash.int.sifira.dk> Peter Willendrup writes: > We are very happy to announce that the new release, > > mcstas-1.8 > > is now available at the usual download page Tillykke til jer alle p? Ris?! Det ser ud til at der stadig sker en masse sp?ndende omkring McStas, det gl?der mig at se. - Kristian. From farhi at ill.fr Tue Mar 16 10:43:38 2004 From: farhi at ill.fr (Emmanuel Farhi) Date: Tue, 16 Mar 2004 10:43:38 +0100 Subject: [neutron-mc] Re: comparing time and lambda monitors References: <37CAC51AC5C1D211966100A0C9ED000A0531D642@exchange07.rl.ac.uk> Message-ID: <4056CC4A.73921A10@ill.fr> Hy Dickon, As you know, McStas components (and monitors) are written by many contributors. Thus the way data is sorted and stored depends on each monitor. Anyway, most of them behave the same way. I think the difference comes from the source, or the way the source is emitted. If you look at 'mcdoc Source_gen' you will see in the doc that the flux is dPhi/dLambda (n/s/AA) over the whole 4Pi sphere, but focused to the target area (guide input), and per source emission area (1/cm^2) . This is the about same in 'Source_Maxwell' sources. There is your 1/Lambda factor. Emmanuel. "Champion, JDM (Dickon)" wrote: > PS- i'm not ruling out the possibility that the input is junk..... > > Dr Dickon Champion > ISIS Facility > R3 Room 1-49 > Rutherford Appleton Laboratory > Chilton > OX11 0QX > > Tel : 01235 446043 (Office) > 07939 084159 (Mobile) > > Fax : 01235 445720 > > > -----Original Message----- > > From: Champion, JDM (Dickon) > > Sent: 15 March 2004 14:45 > > To: 'Geza'; 'klaus'; 'willendrup'; 'Kim Lefmann'; 'Emmanuel Farhi' > > Subject: RE: comparing time and lambda monitors > > > > > > i attach the data files for the two pictures > > > > > > > > Dr Dickon Champion > > ISIS Facility > > R3 Room 1-49 > > Rutherford Appleton Laboratory > > Chilton > > OX11 0QX > > > > Tel : 01235 446043 (Office) > > 07939 084159 (Mobile) > > > > Fax : 01235 445720 > > > > > > > -----Original Message----- > > > From: Champion, JDM (Dickon) > > > Sent: 15 March 2004 14:19 > > > To: Geza; klaus; willendrup; Kim Lefmann; Emmanuel Farhi > > > Subject: comparing time and lambda monitors > > > > > > > > > hi, > > > > > > in my neverending simulation of HET i came across an odd > > > conundrum last week, in an effort to resolve the > > > discrepancies in the flux.... it didn't solve anything, it > > > only created more problems in my head. > > > > > > if i simulate a large range of energy, for example 0.4-2.9 A, > > > and measure the beam 1 cm from the moderator face with two > > > identically configured lambda monitors in vitess and mcstas > > > (there is no point in attaching instrument since they are so > > > basic). even with the slight differences in sampling the > > > beam, you would expect there to be a general agreement > > > between the monitor output. these two datasets are shown in > > > the mcstas.jpg and vitess.jpg files attached. as you can see > > > the distributions are fundamentally different. > > > > > > however stuart and i were playing around with the figures and > > > determined that you can get the vitess plot to agree with the > > > mcstas if you divide the intensity column entries by the > > > lambda column, ie. a 1/lambda correction. i was looking > > > through the source of the modules and it seems to be a simple > > > binning operation. > > > > > > as far as i am aware both modules are supposed to have the y > > > axis in terms of neutrons/second?? am I missing something in > > > the small print somewhere?? are the software packages > > > measuring something different? and if so, why, and why isn't > > > there anything written about it??? > > > > > > there is also quite a difference in the distribution given by > > > identically configures time monitors as well, which isn't > > > evident for a small range in energy, but by dividing through > > > by the time, an improved agreement is again observed. > > > > > > > > > any ideas????? thank you for any light you can shed in this > > matter.... > > > > > > dickon > > > > > > Dr Dickon Champion > > > ISIS Facility > > > R3 Room 1-49 > > > Rutherford Appleton Laboratory > > > Chilton > > > OX11 0QX > > > > > > Tel : 01235 446043 (Office) > > > 07939 084159 (Mobile) > > > > > > Fax : 01235 445720 > > > > > -- What's up Doc ? -------------------------------------------- Emmanuel FARHI, http://www.ill.fr/Computing/people/Farhi \|/ ____ \|/ CS-Group ILL4/156, Institut Laue-Langevin (ILL) Grenoble ~@-/ oO \-@~ 6 rue J. Horowitz, BP 156, 38042 Grenoble Cedex 9,France /_( \__/ )_\ Work :Tel (33/0) 4 76 20 71 35. Fax (33/0) 4 76 20 76 48 \__U_/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From Timur.Elzhov at jinr.ru Tue Mar 16 16:01:57 2004 From: Timur.Elzhov at jinr.ru (Timur Elzhov) Date: Tue, 16 Mar 2004 18:01:57 +0300 Subject: [neutron-mc] making shared object from mcstas-r.c, under WinXP Message-ID: <20040316150156.GA729@nf034.jinr.ru> Dear McStas experts, I successfully compiled shared object libmcstas-r.so from mcstas-r.c file, so now I'm able to compile instruments with --no-runtime option, and link it with that library. That is all under _Linux_. But, when I try to do the same under WindowsXP, I get linking error (MinGW compiler was used): mcstas> gcc -Wno-unused -fPIC -O2 -c mcstas-r.c mcstas> gcc --shared -o libmcstas-r.dll mcstas-r.o C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x498d):mcstas-r.c: undefined reference to `mcinstrument_source' C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x4992):mcstas-r.c: undefined reference to `mcinstrument_name' C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x49a1):mcstas-r.c: undefined reference to `mcinputtable' C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x49ba):mcstas-r.c: undefined reference to `mcinputtable' C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x49d0):mcstas-r.c: undefined reference to `mcinputtable' C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x49d9):mcstas-r.c: undefined reference to `mcinputtable' C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x49ea):mcstas-r.c: undefined reference to `mcinputtable' C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x4a91):mcstas-r.c: more undefined references to `mcinputtable' follow C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x4bea):mcstas-r.c: undefined reference to `mcnx' ... and so on, about 90 lines. Why? Tnanks a lot, Timur. From farhi at ill.fr Tue Mar 16 18:06:51 2004 From: farhi at ill.fr (Emmanuel Farhi) Date: Tue, 16 Mar 2004 18:06:51 +0100 Subject: [neutron-mc] making shared object from mcstas-r.c, under WinXP References: <20040316150156.GA729@nf034.jinr.ru> Message-ID: <4057342B.81A4209D@ill.fr> Hello Timur, you have to compile mcstas-r.c with its mcstas-r.h header file, where the undefined symbols are defined as 'extern'. Indeed thier value is to be set in the instrument itself, not in the run-time library. If the problem persists, send us the full error output so that we see what undefined symbols should be added as 'extern'. Emmanuel. Timur Elzhov wrote: > Dear McStas experts, > > I successfully compiled shared object libmcstas-r.so from mcstas-r.c > file, so now I'm able to compile instruments with --no-runtime option, > and link it with that library. That is all under _Linux_. But, when > I try to do the same under WindowsXP, I get linking error (MinGW compiler > was used): > mcstas> gcc -Wno-unused -fPIC -O2 -c mcstas-r.c > mcstas> gcc --shared -o libmcstas-r.dll mcstas-r.o > C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x498d):mcstas-r.c: undefined reference to `mcinstrument_source' > C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x4992):mcstas-r.c: undefined reference to `mcinstrument_name' > C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x49a1):mcstas-r.c: undefined reference to `mcinputtable' > C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x49ba):mcstas-r.c: undefined reference to `mcinputtable' > C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x49d0):mcstas-r.c: undefined reference to `mcinputtable' > C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x49d9):mcstas-r.c: undefined reference to `mcinputtable' > C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x49ea):mcstas-r.c: undefined reference to `mcinputtable' > C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x4a91):mcstas-r.c: more undefined references to `mcinputtable' follow > C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x4bea):mcstas-r.c: undefined reference to `mcnx' > ... > > and so on, about 90 lines. Why? > > Tnanks a lot, > Timur. > > _______________________________________________ > neutron-mc mailing list > neutron-mc at risoe.dk > http://neutron.risoe.dk/mailman/listinfo/neutron-mc -- What's up Doc ? -------------------------------------------- Emmanuel FARHI, http://www.ill.fr/Computing/people/Farhi \|/ ____ \|/ CS-Group ILL4/156, Institut Laue-Langevin (ILL) Grenoble ~@-/ oO \-@~ 6 rue J. Horowitz, BP 156, 38042 Grenoble Cedex 9,France /_( \__/ )_\ Work :Tel (33/0) 4 76 20 71 35. Fax (33/0) 4 76 20 76 48 \__U_/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From kn at sifira.dk Tue Mar 16 21:31:41 2004 From: kn at sifira.dk (Kristian Nielsen) Date: Tue, 16 Mar 2004 21:31:41 +0100 Subject: [neutron-mc] making shared object from mcstas-r.c, under WinXP In-Reply-To: <4057342B.81A4209D@ill.fr> References: <20040316150156.GA729@nf034.jinr.ru> <4057342B.81A4209D@ill.fr> Message-ID: <7sbrmwo7o2.fsf@ash.int.sifira.dk> From kn at sifira.dk Tue Mar 16 21:31:41 2004 From: kn at sifira.dk (Kristian Nielsen) Date: Tue, 16 Mar 2004 21:31:41 +0100 Subject: [neutron-mc] making shared object from mcstas-r.c, under WinXP In-Reply-To: <4057342B.81A4209D@ill.fr> References: <20040316150156.GA729@nf034.jinr.ru> <4057342B.81A4209D@ill.fr> Message-ID: <7sbrmwo7o2.fsf@ash.int.sifira.dk> Emmanuel Farhi writes: > Hello Timur, > > you have to compile mcstas-r.c with its mcstas-r.h header file, where the undefined symbols are defined as > 'extern'. Indeed thier value is to be set in the instrument itself, not in the run-time library. > If the problem persists, send us the full error output so that we see what undefined symbols should be added > as 'extern'. > > Emmanuel. > > Timur Elzhov wrote: > > > Dear McStas experts, > > > > I successfully compiled shared object libmcstas-r.so from mcstas-r.c > > file, so now I'm able to compile instruments with --no-runtime option, > > and link it with that library. That is all under _Linux_. But, when > > I try to do the same under WindowsXP, I get linking error (MinGW compiler > > was used): > > mcstas> gcc -Wno-unused -fPIC -O2 -c mcstas-r.c > > mcstas> gcc --shared -o libmcstas-r.dll mcstas-r.o > > C:\WINDOWS\TEMP/ccwVaaaa.o(.text+0x498d):mcstas-r.c: undefined reference to `mcinstrument_source' I am not 100% sure, but I think you may have run into a Windows limitation. In Linux, when you load a shared object into a program, the program can refer to symbols in the shared object, but the shared object can also refer to symbols in the program. I believe you are using this on Linux. As far as I know, when a Windows program loads a DLL, the DLL cannot refer directly to symbols in the program. Thus when you link the shared object, it complains about missing symbols at link time; at this point the symbols are not available, since they are not defined until the instrument code is compiled and linked. Anyway, perhaps this brings you further. In any case I found it amusing to see that soneone is finally finding a use for --no-runtime, a feature I have never before seen used but put in originally many years ago just because it felt like the rigth thing to do. - Kristian. From Timur.Elzhov at jinr.ru Wed Mar 17 10:20:59 2004 From: Timur.Elzhov at jinr.ru (Timur Elzhov) Date: Wed, 17 Mar 2004 12:20:59 +0300 Subject: [neutron-mc] making shared object from mcstas-r.c, under WinXP In-Reply-To: <7sbrmwo7o2.fsf@ash.int.sifira.dk> References: <20040316150156.GA729@nf034.jinr.ru> <4057342B.81A4209D@ill.fr> <7sbrmwo7o2.fsf@ash.int.sifira.dk> Message-ID: <20040317092059.GA786@nf034.jinr.ru> Hello, Kristian. -- On Tue, Mar 16, 2004 at 09:31:41PM +0100, you wrote: > I am not 100% sure, but I think you may have run into a Windows > limitation. > > In Linux, when you load a shared object into a program, the program can > refer to symbols in the shared object, but the shared object can also > refer to symbols in the program. I believe you are using this on Linux. > > As far as I know, when a Windows program loads a DLL, the DLL cannot > refer directly to symbols in the program. Thus when you link the shared > object, it complains about missing symbols at link time; at this point > the symbols are not available, since they are not defined until the > instrument code is compiled and linked. Well, if I understand you, I could not build shared obbject from the following code (under Win32): exiern int i; void f(void) { i; } right? But MinGW does build DLL successfully from this test! Or, you mean something else? > Anyway, perhaps this brings you further. In any case I found it amusing > to see that soneone is finally finding a use for --no-runtime, a feature > I have never before seen used but put in originally many years ago just > because it felt like the rigth thing to do. Hm, I found this feature very useful, it seems to save a lot of compiling time, no? :) -- WBR, Timur. From kn at sifira.dk Wed Mar 17 10:38:13 2004 From: kn at sifira.dk (Kristian Nielsen) Date: Wed, 17 Mar 2004 10:38:13 +0100 Subject: [neutron-mc] making shared object from mcstas-r.c, under WinXP In-Reply-To: <20040317092059.GA786@nf034.jinr.ru> References: <20040316150156.GA729@nf034.jinr.ru> <4057342B.81A4209D@ill.fr> <7sbrmwo7o2.fsf@ash.int.sifira.dk> <20040317092059.GA786@nf034.jinr.ru> Message-ID: <7sbrmvhkze.fsf@ash.int.sifira.dk> Timur Elzhov writes: > Well, if I understand you, I could not build shared obbject from the > following code (under Win32): > > exiern int i; > void f(void) > { > i; > } > > right? But MinGW does build DLL successfully from this test! > Or, you mean something else? Well, it could be that the compiler is optimizing away the reference to i. That could be settled by trying this code as a DLL instead: #include extern int i; void f(void) { printf("%d\n", i); } If that compiles, then my guess about Windows DLL restrictions is plain wrong (I am no expert in Windows anyway). - Kristian. From Timur.Elzhov at jinr.ru Wed Mar 17 14:30:07 2004 From: Timur.Elzhov at jinr.ru (Timur Elzhov) Date: Wed, 17 Mar 2004 16:30:07 +0300 Subject: [neutron-mc] making shared object from mcstas-r.c, under WinXP In-Reply-To: <7sbrmvhkze.fsf@ash.int.sifira.dk> References: <20040316150156.GA729@nf034.jinr.ru> <4057342B.81A4209D@ill.fr> <7sbrmwo7o2.fsf@ash.int.sifira.dk> <20040317092059.GA786@nf034.jinr.ru> <7sbrmvhkze.fsf@ash.int.sifira.dk> Message-ID: <20040317133007.GA1225@nf034.jinr.ru> On Wed, Mar 17, 2004 at 10:38:13AM +0100, Kristian Nielsen wrote: >> right? But MinGW does build DLL successfully from this test! >> Or, you mean something else? > > Well, it could be that the compiler is optimizing away the reference to > i. That could be settled by trying this code as a DLL instead: > > #include > extern int i; > void f(void) { > printf("%d\n", i); > } > > If that compiles, then my guess about Windows DLL restrictions is plain > wrong (I am no expert in Windows anyway). It couldn't compile that, it complied about linking error, too. Thank you! :) -- WBR, Timur. From Timur.Elzhov at jinr.ru Wed Mar 17 18:19:11 2004 From: Timur.Elzhov at jinr.ru (Timur Elzhov) Date: Wed, 17 Mar 2004 20:19:11 +0300 Subject: [neutron-mc] TeX sources for McStas docs Message-ID: <20040317171911.GA1826@nf034.jinr.ru> Dear McStas experts. Could I find TeX sources for McStas docs anywhere? I'd like to compile PDF without Type3 (as in mcstas distribution), but with Type1 fonts ... Thanks. -- WBR, Timur From peter.willendrup at risoe.dk Wed Mar 17 18:29:51 2004 From: peter.willendrup at risoe.dk (Peter Kjaer Willendrup) Date: Wed, 17 Mar 2004 18:29:51 +0100 (CET) Subject: [neutron-mc] TeX sources for McStas docs In-Reply-To: <20040317171911.GA1826@nf034.jinr.ru> Message-ID: Hi Timur, On Wed, 17 Mar 2004, Timur Elzhov wrote: > Could I find TeX sources for McStas docs anywhere? I'd like to compile > PDF without Type3 (as in mcstas distribution), but with Type1 fonts ... As such, the docs are not available anywhere in their pure TeX form... That said, we can ofcourse arrange that I send you a tarball with the stuff or equivalent. (Contact me off list - let us make an arrangement) If there is a general wish for availability of the TeX among the list members I will be happy to spend some time making a solution for this... Cheers, Peter -- ------------------------------------- Peter Kjaer Willendrup, Cand. Scient Phone: (+45) 46 77 58 62 email: peter.willendrup at risoe.dk -------------------------------------