# CRTM\_Forward\_Module.f90:undefined reference to \`\_\_kmpc\_global\_thread\_num'

**URL:** <https://forums.jcsda.org/t/crtm-forward-module-f90-undefined-reference-to-kmpc-global-thread-num/285>\
**Category:** CRTM\
**Created:** [March 4, 2022, 10:11pm UTC](https://forums.jcsda.org/t/crtm-forward-module-f90-undefined-reference-to-kmpc-global-thread-num/285 "2022-03-04T22:11:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jun](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/jun/32/122_2.png) [@Jun](https://forums.jcsda.org/u/Jun)\
**Post date:** [March 4, 2022, 10:11pm UTC](https://forums.jcsda.org/t/crtm-forward-module-f90-undefined-reference-to-kmpc-global-thread-num/285/1 "2022-03-04T22:11:21Z")

</div>

Hello,  
I’m trying to use CRTM in my code to do the simulations. I’ve linked the CRTM library to my code. The part of creating and filling CRTM structures is doing well. But when I try to call the function CRTM\_Forward, the following errors pop out as I compile the code. Could you help me solve this issue?  
Thanks!

Jun

 ![Capture](https://canada1.discourse-cdn.com/flex031/uploads/jcsda/original/1X/84ec3880bb00adea6c7fcb7cfbfb4474760db24c.png)

---

<div class="post-metadata">

**Author:** ![Jun](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/jun/32/122_2.png) [@Jun](https://forums.jcsda.org/u/Jun)\
**Post date:** [March 4, 2022, 10:31pm UTC](https://forums.jcsda.org/t/crtm-forward-module-f90-undefined-reference-to-kmpc-global-thread-num/285/2 "2022-03-04T22:31:33Z")

</div>

crtm\_v2.4.0/src/make.macros is included in the makefile for the compiler setting. in which LINUX\_FLAGS = $(LINUX\_FLAGS\_INTEL).

---

<div class="post-metadata">

**Author:** ![Jun](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/jun/32/122_2.png) [@Jun](https://forums.jcsda.org/u/Jun)\
**Post date:** [March 4, 2022, 11:00pm UTC](https://forums.jcsda.org/t/crtm-forward-module-f90-undefined-reference-to-kmpc-global-thread-num/285/3 "2022-03-04T23:00:40Z")

</div>

After doing some search on google, I find the possible cause and solution.  
The problem may be caused by not linked to mp library.  
Adding -qopenmp after ifort would solve the issue.  
Thanks!

Jun

---

<div class="post-metadata">

**Author:** ![StegmannJCSDA](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.jcsda.org/stegmannjcsda/32/53_2.png) [@StegmannJCSDA](https://forums.jcsda.org/u/StegmannJCSDA)\
**Post date:** [March 5, 2022, 5:36pm UTC](https://forums.jcsda.org/t/crtm-forward-module-f90-undefined-reference-to-kmpc-global-thread-num/285/4 "2022-03-05T17:36:46Z")

</div>

Yes, for more recent CRTM versions (v2.4.0 and above) you need to link OpenMP and netCDF4 to your CRTM applications as well.
