+- +-
Say hello if visiting :) by Gecko
11 Jan 2023, 07:43:05 pm

Seti is down again by Mike
09 Aug 2017, 10:02:44 am

Some considerations regarding OpenCL MultiBeam app tuning from algorithm view by Raistmer
11 Dec 2016, 06:30:56 am

Loading APU to the limit: performance considerations by Mike
05 Nov 2016, 06:49:26 am

Better sleep on Windows - new round by Raistmer
26 Aug 2016, 02:02:31 pm

Author Topic: BOINC as library  (Read 33199 times)

Offline Raistmer

  • Working Code Wizard
  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 14349
BOINC as library
« on: 11 Oct 2007, 05:11:56 pm »
I wonder maybe it's worth to distribute boinc as set of libs to link with (for windows) and headers to include (just as usual API-library)?
Just to reduce initial compilation time (and time spent on efforts to make it compile ;) ).

For example gutil_text.C from BOINC 5.5 (sources taken from this site) failed to compile with Intel(R) C++ 10.0.027 [IA-32] used with MS VS 2005 .
Error message:
..\..\..\boinc\api\gutil_text.C(335): error: a value of type "const char *" cannot be used to initialize an entity of type "char *"
      char* q = strchr(p, '\n');
                ^
(this line from next function
void MOVING_TEXT_PANEL::set_text(int lineno, const char* p) {
    char* q = strchr(p, '\n');
    while (p) {
        if (q) *q = 0;
        strlcpy(text[lineno++], p, 256);
        if (!q) break;
        p = q+1;
        q = strchr(p, '\n');
    }
}
)

Offline Jason G

  • Construction Fraggle
  • Knight who says 'Ni!'
  • *****
  • Posts: 8980
Re: BOINC as library
« Reply #1 on: 11 Oct 2007, 05:53:25 pm »
LOL, and the rest of the errors.  I think they should just clean up the source and we can build our own to our own optimisation settings.  which version of boinc api did you use?[I see now, 5.5 sources]  I had the same issues... (VS2005 w/ ICC&IPP)

-  so what did you do about the const char * one ?

-  what about-  position_history(0) on line 126 of seti_header.cpp ?

(just curious to see if you did the same as I did :D, I'd have to go back and look what I did and compare)

Jason
« Last Edit: 11 Oct 2007, 06:25:10 pm by j_groothu »

Offline Raistmer

  • Working Code Wizard
  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 14349
Re: BOINC as library
« Reply #2 on: 11 Oct 2007, 06:31:04 pm »
For now I just downloaded 5.10.20 release sources :)
So libboincapi compiles w/o errors now but setiboincdb leads to error:
"
..\..\db\xml_util.cpp(641): error: identifier "strlcpy" is undefined
        strlcpy(tmp_tag,tag,BUFSIZ);
        ^
"
It seems some include line or define is missing.... strange, uncompilable release?  :o

About seti_header.cpp : got such error
"
seti_header.cpp
compilation aborted for ..\seti_header.cpp (code 4)
Command-line error: cannot open precompiled header input file Release32-NoGFX-xP\KWSN_2.3S9_MB_SSE.pchi
"
I use MS VS very occasionally so need some time to understand why compilation is bothered by lack of precompiled header at fresh build run... why it cant generate new precomp header?  :-\

P.S. Ah, generate precomp headers  was just turned off :) So now it complains only about "ipp_t7.h" missing (i use eval version of IPP so probably need to edit all these includes ).
No mention of position_history in errors log so far.
« Last Edit: 11 Oct 2007, 06:40:45 pm by Raistmer »

Offline Jason G

  • Construction Fraggle
  • Knight who says 'Ni!'
  • *****
  • Posts: 8980
Re: BOINC as library
« Reply #3 on: 11 Oct 2007, 06:55:41 pm »
first have a look in Util.h line 31, and see if the #if !defined(HAVE_STRLCOPY)) , is active... if it is then implementation in util.c will be active too.  If those aren't active then HAVE_STRLCOPY is defined, you can 'find in files' to locate the definition if there is one.  If it is defined then maybe a wrong preprocessor definition is there (e.g _GCC or _MSCVER)

that bit was okay for me.

The precompiled headers need to be generated at least the first time,  In the master projects I just set them on the C++ section -> Precompiled Headers to 'Create Precompiled Headers' and left them there for now.  It'll save time to change it back later when you build pieces often, but don't need to alter the headers anymore.
[ I see you found this -- Good one :D]

For now you probably do need to creat them(because they aren't there, and) because some of the includes and defines are messed up.

[The Intel Include will be processor specific, chosen by ICC,  just add the right directory in your 'additional include directories' to your ICC installation, and add IPP for good measure :D]




« Last Edit: 11 Oct 2007, 06:59:20 pm by j_groothu »

Offline Raistmer

  • Working Code Wizard
  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 14349
Re: BOINC as library
« Reply #4 on: 11 Oct 2007, 07:17:39 pm »
thanks  :)
I found that addition of
#include "str_util.h"
line to xml_util.cpp heals setiboincdb project.
tomorrow will continue with IPP.

Offline Raistmer

  • Working Code Wizard
  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 14349
Re: BOINC as library
« Reply #5 on: 18 Oct 2007, 01:41:52 pm »
It took some more to return %)
Well, after some edition of include statements I got all solution to compile but now have some errors on link stage.
"
Linking... (Intel C++ Environment)
ipo: error #11033: Fatal error cannot open Release32-NoGFX-xP/analyzeFuncs.obj
xilink: error error_during_IPO_compilation: problem during multi-file optimization compilation (code 1)
xilink: error error_during_IPO_compilation: problem during multi-file optimization compilation (code 1)
"
And there is no analyzeFuncs.obj indeed! I tried to compile it as single file, it compiles OK, but still no obj anywhere... Any ideas?

Offline Jason G

  • Construction Fraggle
  • Knight who says 'Ni!'
  • *****
  • Posts: 8980
Re: BOINC as library
« Reply #6 on: 18 Oct 2007, 05:10:12 pm »
Maybe the IPP include directories for the static libs (intel), for the seti_boinc project ?:
Quote
C:\Program Files\Intel\IPP\5.1\ia32\tools\staticlib
C:\Program Files\Intel\IPP\5.1\ia32\include
C:\Program Files\Intel\Compiler\C++\9.1\IA32\Include
(On my machine, you'll be different location or IPP version)


A small thing that was broken in my first attempts (that might relate to analysefuncs)  was:
    - The cmath include was defined as nothing and there are duplicates in multiple places .  In the code I have the #define in one of the config.h' files was commented out and marked 'more work needed.'

The 'more work needed' is to realise that MATH_LIB is multiply included in some files (breaking comoilation if wanting intel MKL) . Commenting out a few #include 'math.h' (which should say MATH_LIB anyway,  is a once only per module deal, and  has already been included in one of the configs.).  Fixing CMATH include to point to cmath from microsoft (not mkl, it doesn't have one) fixes something too (if using MKL.)



« Last Edit: 18 Oct 2007, 05:18:45 pm by j_groothu »

Offline Jason G

  • Construction Fraggle
  • Knight who says 'Ni!'
  • *****
  • Posts: 8980
Re: BOINC as library
« Reply #7 on: 18 Oct 2007, 05:30:31 pm »
Hmm did a quick search on that error you mention.  If you check the buildlog.htm it might say something about 'could not open' a certain file.

Indications are this maybe occurs when either there is not proper access rights to the TEMP directory,  or that VS2005 was installed in a different login account

Offline Raistmer

  • Working Code Wizard
  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 14349
Re: BOINC as library
« Reply #8 on: 18 Oct 2007, 05:34:53 pm »
Well, think no static libs cause I use trial version of IPP that supports only dynamic linkage. And I doesnt use MKL at all.
What makes me curious is why compiler doesnt ganerate object file for source file that compiled OK (w/o any errors).

Offline Raistmer

  • Working Code Wizard
  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 14349
Re: BOINC as library
« Reply #9 on: 18 Oct 2007, 05:36:23 pm »
"Could not open" just means the file doesnt exists at all. And why it doesnt exists.... ?  :o

(I use admin account, the same that I used for VS installation, no special access rights was applied )

P.S.
Full output:

Output Window      Compiling with Intel(R) C++ 10.0.027 [IA-32]... (Intel C++ Environment)
gaussfit.cpp
seti_header.cpp
analyzeReport.cpp
pulsefind.cpp
timecvt.cpp
analyzePoT.cpp
schema_master.cpp
progress.cpp
chirpfft.cpp
sah_gfx_base.cpp
sah_gfx.cpp
worker.cpp
spike.cpp
s_util.cpp
malloc_a.cpp
analyzeFuncs.cpp
lcgamm.cpp
main.cpp
gdata.cpp
seti.cpp
version.cpp
Linking... (Intel C++ Environment)
ipo: error #11033: Fatal error cannot open Release32-NoGFX-xP/analyzeFuncs.obj
xilink: error error_during_IPO_compilation: problem during multi-file optimization compilation (code 1)
xilink: error error_during_IPO_compilation: problem during multi-file optimization compilation (code 1)
 
As one can see, analyzeFuncs.cpp was compiled w/o errors, but no analyzeFuncs.obj exist.
« Last Edit: 18 Oct 2007, 05:45:01 pm by Raistmer »

Offline Jason G

  • Construction Fraggle
  • Knight who says 'Ni!'
  • *****
  • Posts: 8980
Re: BOINC as library
« Reply #10 on: 18 Oct 2007, 05:53:27 pm »
Well just to see if it maybe is in the compiler stage not producing .obj,  or putting it in the wrong location,  maybe turn on assembly output .asm file for analyzefuncs.cpp  and see where that goes.... (with just a recompile of that file, not a link.)

 the output directories for asm and object files on mine [analyzefuns.cpp, C++ output files]  are set to '$(Intdir)' which I beleive is inherited, so they should be in the release directory (analyzefuncs.obj is sitting there in mine)

Jason
« Last Edit: 18 Oct 2007, 06:03:04 pm by j_groothu »

Offline Raistmer

  • Working Code Wizard
  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 14349
Re: BOINC as library
« Reply #11 on: 18 Oct 2007, 06:12:02 pm »
Wow I just did what you suggest to do :)
I turned on asm output (as verbose as it could be - /FAcs option) , replaced $(Intdir) with '.' and compiled again... No obj, no asm....
Only these files was found :
analyzeFuncs.cpp
analyzeFuncs.h
analyzeFuncs.i
seti_boinc-analyzeFuncs.Po

And nothing more with analyzeFuncs in the file name ...

Offline Jason G

  • Construction Fraggle
  • Knight who says 'Ni!'
  • *****
  • Posts: 8980
Re: BOINC as library
« Reply #12 on: 18 Oct 2007, 06:18:54 pm »
Well that IS wierd  :o.  The only thing I can think of is that somehow Analysefuncs is set to exclude from build.

What happens if you 'clean only' seti_boinc solution then only comple analyzefuncs? same thing ?

Offline Raistmer

  • Working Code Wizard
  • Volunteer Developer
  • Knight who says 'Ni!'
  • *****
  • Posts: 14349
Re: BOINC as library
« Reply #13 on: 18 Oct 2007, 06:24:18 pm »
Yes, the same. It tried to build only one project, to compile only one analyzeFuncs.cpp file, even to switch back to VS-style project and compile analyzeFuncs.cpp via MS compiler.
Results the same (exept MS compiler complained about unknown options
------ Build started: Project: seti_boinc, Configuration: Release32-NoGFX-xP Win32 ------
Compiling...
cl : Command line warning D9002 : ignoring unknown option '/Qprec-div-'
cl : Command line warning D9002 : ignoring unknown option '/Qprec-sqrt-'
cl : Command line warning D9002 : ignoring unknown option '/QxW'
analyzeFuncs.cpp
) no analyzeFuncs.obj was generated.

Offline Jason G

  • Construction Fraggle
  • Knight who says 'Ni!'
  • *****
  • Posts: 8980
Re: BOINC as library
« Reply #14 on: 18 Oct 2007, 06:33:12 pm »
one small difference there.... I am doing a release QxW , and mine goes to the xW Release directory,  Shouldn't yours be set to /QxP and be going to the Release xP ?... maybe that compiler command line.

 

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?
Members
Total Members: 97
Latest: ToeBee
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 59559
Total Topics: 1672
Most Online Today: 50
Most Online Ever: 983
(20 Jan 2020, 03:17:55 pm)
Users Online
Members: 0
Guests: 38
Total: 38
Powered by EzPortal