Free Downloads, Community Forum,
FAQs and Developer Resources


Make /Tools Your Home | Link to us

Today's posts | Posts since last visit | Most Active Topics

All Forums Register Login Search Subscriptions My Profile Inbox
Tool Warehouse FAQs Resources Help Member List Address Book Logout

Toying around with wcc

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [SFU / Interix / SUA Technology] >> Interix Advanced Forum >> Toying around with wcc Page: [1]
Login
Message << Older Topic   Newer Topic >>
Toying around with wcc - Feb. 15, '06, 3:03:09 AM   
heinz456

 

Posts: 4
Status: offline
Hi,
my name is Heinz and this is my first posting.
I am currently porting a rather large project (~0.5 Mloc) from Unix (multiplattform) to Windows.
The main language is C, but for the sake of configuring, it depends on Fortran(F77..F95),
OpenMP, pthreads and MPI.
I wonder which part of the script has to be changed to use symbols (i use WIN32 to separate my code).
Btw i also have to use Intels Fortran Compiler to build a variety of project related test progs and want
customize wcc for that reason. Any points, where to start adding/changing stuff ???
Thx in advance HeinZ
Post #: 1
RE: Toying around with wcc - Feb. 15, '06, 10:36:33 PM   
markfunk

 

Posts: 670
Joined: Mar. 31, '03,
Status: offline
This is a loaded question.
You either need to go read all the docs that Microsoft provides for
porting UNIX apps to Windows, or hire yourself a UNIX to Windows consultant.

You need to understand how much source code you have, what dependencies
it has on UNIX api's (versus ANSI-C or F77 apis) and what type of build
environment you depend upon (ie do you use 'make').

Your main choices are:
- use cygwin tools or perhaps the MKS toolkit if you depend on Win32 libraries
- use Interix tools if you have all your own source code
- roll your own solution and perhaps use Interix tools to build Win32 objects
using the MS compiler and my (Interix's) version of wcc.

You mention pthreads. Your choice could be narrowed down a lot by this
requirement. You'll have to determine which tools provide the best pthread
compatibility that suits your needs.

(in reply to heinz456)
Post #: 2
RE: Toying around with wcc - Feb. 16, '06, 2:45:26 AM   
heinz456

 

Posts: 4
Status: offline
Hi,
and thanx for your fast reply. First up, i went the road you
sugessted(except that consultant thing, man i am into computers since '82).
I started with SFU and got to the point, where all except
one thing was up and could run, if i had a chance to. The problem
was, that gcc seg faulted on one specific file. So i tried another version of gcc(4.0.1)
and had the same outcome (segmentation fault). Then i tried to get the hotfix, mentioned
in one of the other posts. But to get this baby i would have spent to much time on wrestling
around with some accountants here (No offense). But there was plan b (mingw) and plan c (cygwin)
(... and also plan d, but that got dropped due to missing contacts to the russian mafia ...;-) )
Mingw was dropped, because pthreads weren't directly supported the way i wanted it to be, and as
i recall, the posix compability is missing.
After some long and painfull installation sessions i had cygwin up and running.
And i presume a couple of minutes later the whole software package compiled cleanly.
Some minor bugs later even the test examples provided, gave the results i expected.
But the ultimate goal is still, to convert the whole package into a microsoft thing, involving:
a) Correcting the sourcecode, where needed.
(The software package was written in plain C, without any signals and other hardcore Unix stuff)
Only paths, timer and some minor functions (file access and getpid()) had to be corrected (No problem).
The sourcecode compiled cleanly (read : lots of warnings, but no errors, as of the Linux version
i use as reference) Btw there is a pthread implemantation.. .
b) Convert to several visual studio projects for future ms only stuff (wmi).
No problems at all.
c) Convert the test examples and get them up and runnig.
d) Correcting errors. hmm...
e) Building a ms install package.
Result of c) ähh, ähh, ähh, ALARM. This is the point MPI, etc. pp. comes
into play. The problem right now is:
The test examples (C, Fortran77..95, High Performance Fortran, some using MPI)
are organized in a big directory tree, where the
bottom of the subtree are the test programs. To compile this, you
only need cd to the root directory of this subtree, do a "make" and
there you go. To start all the test programs you invoke a "make run".
This is when nmake comes into play and failed misarebly. To convert the
Makefiles on the bottom is not that problem, but the rest is a problem,
because of the number of files etc. pp. ok, that means scripting and converting
to nmake style makefiles. After a lot of reading and testing i decided, that nmake dont have the
capabilities, ok, i didn't find a way for converting, maybe i am to stupid.
On this point i remebered that SFU is able to execute ms commandline programs
within a SFU shell and there was wcc to wrap around lc and do it the way i wanted
it, and so i was back in business. But my first make run was errornous,
clearly indicating that i am still in a unix enviroment. So i have to change
one or more symbols and provide my defined symbol.
My question is where do i have to change the script ?
Btw, i found out that fortran is not needed any more, because it's called within
one of the programs (stupid me).
Thanx in advance
HeinZ

(in reply to markfunk)
Post #: 3
RE: Toying around with wcc - Feb. 16, '06, 8:23:33 AM   
markfunk

 

Posts: 670
Joined: Mar. 31, '03,
Status: offline
quote:

So i have to change
one or more symbols and provide my defined symbol.
What do you mean by this ? What symbols ?

(in reply to heinz456)
Post #: 4
RE: Toying around with wcc - Feb. 16, '06, 8:42:21 AM   
heinz456

 

Posts: 4
Status: offline
hi,
i meant _DEBUG, _CONSOLE, WIN32 stuff like that.
Short example:
.....
#ifdef WIN32
#include <io.h>
#include <process.h>
#else
#include <unistd.h>
#endif
.....
In my case i will get an error while
compiling like cant't find unistd.h,
which indicates the symbol WIN32 was
not set and the #else path was taken.
On the commandline you would use :
cl .... /D"WIN32" .... test.c
I hope i made myself clear.
Best regards HeinZ

(in reply to heinz456)
Post #: 5
RE: Toying around with wcc - Feb. 21, '06, 5:39:09 PM   
ender

 

Posts: 13
Joined: Aug. 16, '05,
Status: offline
If you need pthreads on native Win32 (no cygwin), there's pthreads-win32, a LGPL implementation. AFAIK, the Evolution Windows port uses these.

(in reply to heinz456)
Post #: 6
RE: Toying around with wcc - Feb. 22, '06, 2:58:47 AM   
heinz456

 

Posts: 4
Status: offline
Hi,
thank you for your link to pthreads implementation.
I use it and it apperently works.
I also got that symbol thing (see earlier post)
after getting an error and inspecting the script, solved
(use -d"..." instead of /D"...", silly me).
But there is still no exec file. The script passes as far
as i remember the -o option directly to the M$ compiler,
which returns an error. Any idea what to do or where to
add something in the wcc script.
Thx in advance HeinZ

(in reply to ender)
Post #: 7
RE: Toying around with wcc - Feb. 22, '06, 11:00:41 PM   
markfunk

 

Posts: 670
Joined: Mar. 31, '03,
Status: offline
What's the error message you're getting ?

To help debug what compiler commands wcc is executing,
set the C89_ECHO env variable to the value of 1.
(ie. export C89_ECHO=1)

(in reply to heinz456)
Post #: 8
Page:   [1]
All Forums >> [SFU / Interix / SUA Technology] >> Interix Advanced Forum >> Toying around with wcc Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Search All Forums -

Advanced search


SPONSORS



Forum Software © ASPPlayground.NET Advanced Edition 2.5 ANSI

0.047