CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > CONVERGE

safe_malloc build error in user_spray_udf

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By SauravMitra

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 2, 2016, 07:07
Exclamation safe_malloc build error in user_spray_udf
  #1
New Member
 
Join Date: Aug 2015
Location: Alexandria, Egypt
Posts: 10
Rep Power: 10
kabil is on a distinguished road
Hi all

In user_spray_udf there are a couple of lines for memory allocation that keeps making build error. those lines are:

/// islam memory allocation check for a bug
vapor_mass_0=(double *)safe_malloc(num_parcel_species*sizeof(double));
vapor_mass=(double *)safe_malloc(num_parcel_species*sizeof(double));
local_species=(double *)safe_malloc(num_total_species*sizeof(double));
temp_boil=(PRECISION *)safe_malloc(num_parcel_species*sizeof(double));

The build error is:

Undefined symbols for architecture x86_64:
"safe_malloc(unsigned long)", referenced from:
user_spray_evap_cell(parcel_cell_definition*, double*, double*) in main.cpp.o

My solution was to swap "safe_malloc" with "malloc" and it worked.

is there another solution like adding a function in header files ??

Thanks in advance
kabil is offline   Reply With Quote

Old   August 2, 2016, 11:10
Default
  #2
New Member
 
SauravMitra's Avatar
 
Saurav
Join Date: Dec 2015
Location: Convergent Science, Madison, USA
Posts: 27
Rep Power: 10
SauravMitra is on a distinguished road
Hi Kabil,

Make sure that you had taken care of the following :

1) All the header files are there in the UDF directory. Especially in your case, it looks like safe_prototypes.h might be missing.

2) user_dynamic_routines.c is there in the UDF directory.

3) The makefile for UDF refer to the respective object files for the C-routines you are compiling.

I am guessing one of the above is not taken care of, which leads to build error message. If that is not the case, please send your files to support@convergecfd.com to have a closer look at this.


Thanks
kabil likes this.
__________________
Saurav Mitra
Senior Research Engineer
CONVERGECFD
SauravMitra is offline   Reply With Quote

Reply

Tags
converge cfd, udf


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Building from Source on Windows using Cygwin64 ericthefatguy SU2 2 May 12, 2015 18:23
SU2 3.0 build failure waku2005 SU2 Installation 4 January 24, 2014 12:40
Hardware build review/advise for student desktop AerE Hardware 10 July 5, 2013 06:03
System Build Advice for FEA cycleback Hardware 1 February 8, 2013 20:53
64bitrhel5 OF installation instructions mirko OpenFOAM Installation 2 August 12, 2008 18:07


All times are GMT -4. The time now is 01:39.