# Error installation

**URL:** <https://forum.cmascenter.org/t/error-installation/2747>\
**Category:** Speciation Tool\
**Created:** [October 26, 2021, 7:26am UTC](https://forum.cmascenter.org/t/error-installation/2747 "2021-10-26T07:26:35Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![farzad-faghihi](https://avatars.discourse-cdn.com/v4/letter/f/e0b2c6/32.png) [@farzad-faghihi](https://forum.cmascenter.org/u/farzad-faghihi)\
**Post date:** [October 26, 2021, 7:26am UTC](https://forum.cmascenter.org/t/error-installation/2747/1 "2021-10-26T07:26:36Z")

</div>

Hi.  
I am trying to install SPC Tool v5. Everything is ok until I created a user account in pgsql and when I run `./sptool_reqd_checks.sh`, I got this error:

> ------PERL------  
> Perl  
> -DBI  
> -DBD-Pg  
> -Text-CSV
> 
> —POSTGRESQL—  
> PostgreSQL  
> Error: pg\_wrapper: createlang was not found in /usr/lib/postgresql/14/bin  
> -PL/pgSQL

Anyone could help me how to solve it?  
Best regard.

---

<div class="post-metadata">

**Author:** ![eyth.alison](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@eyth.alison](https://forum.cmascenter.org/u/eyth.alison)\
**Post date:** [October 26, 2021, 3:14pm UTC](https://forum.cmascenter.org/t/error-installation/2747/2 "2021-10-26T15:14:02Z")

</div>

We have determined that this is a problem with Postgres 10 and later; a helper program was deprecated and then removed.

For a quick fix, comment out or remove lines 163 through 174 in init\_sptooldb\_v5.0.csh

set list = `$POSTGRES\_BIN/createlang -l -U $SPTOOL\_USER $SPTOOL\_DB |

grep plpgsql` if ( “$list” =~ _plpgsql_ ) then

echo "NOTICE: plpgsql language exists.”

else

…

endif

Also as a heads up, we are getting close to releasing Speciation Tool v5.1 which will incorporate all of the profiles from SPECIATE 5.1.

This release will probably happen in November.

---

<div class="post-metadata">

**Author:** ![farzad-faghihi](https://avatars.discourse-cdn.com/v4/letter/f/e0b2c6/32.png) [@farzad-faghihi](https://forum.cmascenter.org/u/farzad-faghihi)\
**Post date:** [October 27, 2021, 9:18am UTC](https://forum.cmascenter.org/t/error-installation/2747/3 "2021-10-27T09:18:40Z")

</div>

Thanks for your response.  
I did what you said. Although the previous problem is solved, I have another problem for executing `./init_sptooldb_v5.0.csh`.  
I recive this when I run ./init\_sptooldb\_v5.0.csh:

> farzad-faghihi:~/SPTOOL/Speciation-Tool-Speciation\_Tool\_5.0\> ./init\_sptooldb\_v5.0.csh
> 
> SPTOOL\_SRC\_HOME = /home/farzad/SPTOOL/Speciation-Tool-Speciation\_Tool\_5.0/src  
> PERL\_DBI = Pg  
> New database: SPTOOL\_DB = sptoolv5\_0alpha\_t1  
> SPTOOL\_USER = farzad  
> PERL\_BIN = /usr/bin  
> POSTGRES\_BIN = /usr/bin  
> /home/farzad/SPTOOL/Speciation-Tool-Speciation\_Tool\_5.0/import\_data/speciate5.0\_exports/export\_profiles\_2019\_0826.txt\_clean  
> /home/farzad/SPTOOL/Speciation-Tool-Speciation\_Tool\_5.0/import\_data/speciate5.0\_exports/export\_species\_properties\_2020\_0313.txt\_clean  
> Database sptoolv5\_0alpha\_t1 created  
> CREATE SCHEMA  
> Shared schema created  
> GRANT  
> Create permissions granted on sptoolv5\_0alpha\_t1  
> GRANT  
> All permissions granted on shared schema  
> Defining custom functions and initializing tables. …working
> 
> Speciation Tool functions and tables successfully defined in sptoolv5\_0alpha\_t1.  
> Importing mechanisms /home/farzad/SPTOOL/Speciation-Tool-Speciation\_Tool\_5.0/import\_data/mechanism\_forImport.11Feb2020.csv  
> Cannot open file: /home/farzad/SPTOOL/Speciation-Tool-Speciation\_Tool\_5.0/import\_data/mechanism\_forImport.11Feb2020.csv  
> Issuing rollback() due to DESTROY without explicit disconnect() of DBD::Pg::db handle dbname=sptoolv5\_0alpha\_t1 at /home/farzad/SPTOOL/Speciation-Tool-Speciation\_Tool\_5.0/src/import\_rawdata.pl line 325.  
> ERROR: perl script failed for importing mechanisms file /home/farzad/SPTOOL/Speciation-Tool-Speciation\_Tool\_5.0/import\_data/mechanism\_forImport.11Feb2020.csv

How can I solve this?  
@eyth.alison.  
Thanks again.

---

<div class="post-metadata">

**Author:** ![cseppan](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@cseppan](https://forum.cmascenter.org/u/cseppan)\
**Post date:** [October 27, 2021, 5:16pm UTC](https://forum.cmascenter.org/t/error-installation/2747/4 "2021-10-27T17:16:33Z")

</div>

There’s a mismatch between the names of the data files in the import\_data directory and those specified in the Assigns.sptool file. To fix it, update the filenames for MECHANISM, MECHANISM\_DESCRIPTION, and CARBONS in the Assigns.sptool file:

`setenv MECHANISM $IDIR/mechanism_forImport_11Feb2020_speciate5_0_withSOAALK_13mar2020_v0.csv`

`setenv MECHANISM_DESCRIPTION	$IDIR/sptool_mechanism_description_speciate5_0_04mar2020_v0.csv`

`setenv CARBONS $IDIR/carbons_all_mechanisms_speciate5_0_04mar2020_v0.csv`

---

<div class="post-metadata">

**Author:** ![farzad-faghihi](https://avatars.discourse-cdn.com/v4/letter/f/e0b2c6/32.png) [@farzad-faghihi](https://forum.cmascenter.org/u/farzad-faghihi)\
**Post date:** [October 27, 2021, 6:38pm UTC](https://forum.cmascenter.org/t/error-installation/2747/5 "2021-10-27T18:38:51Z")

</div>

@cseppan.  
Thanks for your response.  
I did what you said. Although the previous problem is solved, I received another error.  
[error.txt](https://forum.cmascenter.org/uploads/short-url/1gbU4quASvKBz1nUYEDu3KJh9Ao.txt) (3.4 KB)  
[Assigns.sptool.txt](https://forum.cmascenter.org/uploads/short-url/81Z3P6pLTNj4iBfkQH6mD5ZCIar.txt) (4.5 KB)

---

<div class="post-metadata">

**Author:** ![cseppan](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@cseppan](https://forum.cmascenter.org/u/cseppan)\
**Post date:** [October 27, 2021, 7:12pm UTC](https://forum.cmascenter.org/t/error-installation/2747/6 "2021-10-27T19:12:12Z")

</div>

Looks like there was an update to the mechanism description file, but the file in the CMAS package didn’t get updated. You can download the fixed file from the following location, then put it into the import\_data directory.

[https://raw.githubusercontent.com/CMASCenter/Speciation-Tool/master/import\_data/sptool\_mechanism\_description\_speciate5\_0\_04mar2020\_v0.csv](https://raw.githubusercontent.com/CMASCenter/Speciation-Tool/master/import_data/sptool_mechanism_description_speciate5_0_04mar2020_v0.csv)

---

<div class="post-metadata">

**Author:** ![farzad-faghihi](https://avatars.discourse-cdn.com/v4/letter/f/e0b2c6/32.png) [@farzad-faghihi](https://forum.cmascenter.org/u/farzad-faghihi)\
**Post date:** [October 30, 2021, 6:32am UTC](https://forum.cmascenter.org/t/error-installation/2747/7 "2021-10-30T06:32:41Z")

</div>

Thanks for your response.  
I test your Idea to solve the error and it worked.

Thanks again.

---

<div class="post-metadata">

**Author:** ![farzad-faghihi](https://avatars.discourse-cdn.com/v4/letter/f/e0b2c6/32.png) [@farzad-faghihi](https://forum.cmascenter.org/u/farzad-faghihi)\
**Post date:** [November 6, 2021, 7:34am UTC](https://forum.cmascenter.org/t/error-installation/2747/8 "2021-11-06T07:34:57Z")

</div>

Hi again.  
I have problem when I run the speciation tool.these are my runctl file, output and error I received.  
[RUNCTL.txt](https://forum.cmascenter.org/uploads/short-url/htHJqLpVDVcsUqEGAkze2iTxCxd.txt) (278 Bytes)  
[gspro.cb6\_ae6\_VOC.CMAQ.2021nov3.txt](https://forum.cmascenter.org/uploads/short-url/4T7I7GjuWXxLbr3HObfyt0yJao0.txt) (229.1 KB)  
[error.txt](https://forum.cmascenter.org/uploads/short-url/d5zylEX8nD0xAVXsDtwEFPSd7vp.txt) (340.9 KB)  
Thanks.

---

<div class="post-metadata">

**Author:** ![farzad-faghihi](https://avatars.discourse-cdn.com/v4/letter/f/e0b2c6/32.png) [@farzad-faghihi](https://forum.cmascenter.org/u/farzad-faghihi)\
**Post date:** [November 8, 2021, 8:00am UTC](https://forum.cmascenter.org/t/error-installation/2747/9 "2021-11-08T08:00:50Z")

</div>

No one?  
could someone help me? 🤕

---

<div class="post-metadata">

**Author:** ![eyth.alison](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@eyth.alison](https://forum.cmascenter.org/u/eyth.alison)\
**Post date:** [November 8, 2021, 3:12pm UTC](https://forum.cmascenter.org/t/error-installation/2747/10 "2021-11-08T15:12:51Z")

</div>

The specified MECH\_BASIS is “CB6R3\_AE6”, but that is not an active mechanism name. Try setting MECH\_BASIS = CB6R3\_AE

---

<div class="post-metadata">

**Author:** ![farzad-faghihi](https://avatars.discourse-cdn.com/v4/letter/f/e0b2c6/32.png) [@farzad-faghihi](https://forum.cmascenter.org/u/farzad-faghihi)\
**Post date:** [November 9, 2021, 6:10am UTC](https://forum.cmascenter.org/t/error-installation/2747/11 "2021-11-09T06:10:14Z")

</div>

Thanks for your response.  
@eyth.alison  
I did what you recommended, but I received the same error I sent here before. of course it needs to be spoken that the UNK that were produced in gspro.cb6\_ae6\_voc is solved.

---

<div class="post-metadata">

**Author:** ![eyth.alison](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@eyth.alison](https://forum.cmascenter.org/u/eyth.alison)\
**Post date:** [November 9, 2021, 1:10pm UTC](https://forum.cmascenter.org/t/error-installation/2747/12 "2021-11-09T13:10:46Z")

</div>

Apologies – I may have missed a character in my previous response – did you set MECH\_BASIS to this? CB6R3\_AE7

---

<div class="post-metadata">

**Author:** ![farzad-faghihi](https://avatars.discourse-cdn.com/v4/letter/f/e0b2c6/32.png) [@farzad-faghihi](https://forum.cmascenter.org/u/farzad-faghihi)\
**Post date:** [November 10, 2021, 6:22am UTC](https://forum.cmascenter.org/t/error-installation/2747/13 "2021-11-10T06:22:42Z")

</div>

Thanks  
It is ok, I set it to CB6R3\_AE7.  
anyway, the end of the run is written, it was completed but also before it is written unabel to open some files.

```auto
NOTICE: ...renormalizing profile weights
NOTICE: ...calculating moles per gram emissions
NOTICE: ...calculating mole percent
NOTICE: ...calculating moles per mole emissions
NOTICE: ...summing on AQM pollutant
NOTICE: ...calculating mole weight percent
NOTICE: ...calculating average molecular weight by species
NOTICE: ...calculating average molecular weight by AQM
Completed splits calculations

NOTICE: Preparing output tables ... 
NOTICE: ...completed nonHAP
NOTICE: ...rename output AQM pollutants 

Completed output preparations
SUMMARY: Number of profiles generated in run farzad12 is 2543 

Unable to open SPECIATE VP output file for writing: ../outputs/SPECIATE5_VP.IVOCP6-SVOCN1.2021Nov6.txt
Completed writing the output files for run farzad12 
Finished run_sptool.pl

```

can I ignore it or not ?

---

<div class="post-metadata">

**Author:** ![lizadams](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lizadams](https://forum.cmascenter.org/u/lizadams)\
**Post date:** [November 10, 2021, 6:52pm UTC](https://forum.cmascenter.org/t/error-installation/2747/14 "2021-11-10T18:52:38Z")

</div>

This may be an error that results from the outputs directory not being created prior to creating the file into that directory.  
You could use something like the following command to make the outputs directory and ru-run the script.  
(I can’t tell where the outputs directory needs to be created, but if you run this command from the same location where you have your run script, this may work.)

mkdir …/outputs

---

<div class="post-metadata">

**Author:** ![cseppan](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@cseppan](https://forum.cmascenter.org/u/cseppan)\
**Post date:** [November 10, 2021, 8:18pm UTC](https://forum.cmascenter.org/t/error-installation/2747/15 "2021-11-10T20:18:28Z")

</div>

As Liz suggested, the program isn’t able to open the SPECIATE VP output file for writing. Your RUNCTL file explicitly sets the locations for the GSPRO and GSCNV files, e.g.

/home/farzad/SPTOOL/Speciation-Tool-Speciation\_Tool\_5.0/outputs/gspro.cb6\_ae6\_VOC.CMAQ.2021nov3.txt

The location of the SPECIATE VP output file isn’t configurable, and it tries to be written to a directory relative to the Speciation Tool’s “src” directory (…/outputs). This directory already exists as part of the Speciation Tool download package, so I’m not sure why the program can’t write to it. Maybe double-check the permissions, or if you’ve manually moved things around, make sure the outputs directory exists where expected.

Regarding the SPECIATE VP output file, I’m not sure what it’s used for (if anything). It’s not an input file needed for running SMOKE. There’s a sample output file provided in the outputs directory (outputs/SPECIATE5\_VP.IVOCP6-SVOCN1.2020Mar18.txt). So it’s probably safe to ignore the error.

---

<div class="post-metadata">

**Author:** ![farzad-faghihi](https://avatars.discourse-cdn.com/v4/letter/f/e0b2c6/32.png) [@farzad-faghihi](https://forum.cmascenter.org/u/farzad-faghihi)\
**Post date:** [November 11, 2021, 7:15am UTC](https://forum.cmascenter.org/t/error-installation/2747/16 "2021-11-11T07:15:00Z")

</div>

Thanks for your response.  
@cseppan  
@lizadams  
So it’s safe to ignore it.  
But I wonder why the programme needs to find SPECIATE5\_VP.IVOCP6-SVOCN1.2021Nov11.txt file,  
of course, there is that file in the output directory as SPECIATE5\_VP.IVOCP6-SVOCN1.2020Mar18.txt.

Maybe, It has not been updated but it is needed.

---

<div class="post-metadata">

**Author:** ![cseppan](https://avatars.discourse-cdn.com/v4/letter/c/6de8d8/32.png) [@cseppan](https://forum.cmascenter.org/u/cseppan)\
**Post date:** [November 11, 2021, 7:12pm UTC](https://forum.cmascenter.org/t/error-installation/2747/17 "2021-11-11T19:12:52Z")

</div>

The file SPECIATE5\_VP.IVOCP6-SVOCN1.[run\_date].txt is an output file that gets created when the Speciation Tool is run. The outputs directory contains sample outputs from previous runs.

---

<div class="post-metadata">

**Author:** ![farzad-faghihi](https://avatars.discourse-cdn.com/v4/letter/f/e0b2c6/32.png) [@farzad-faghihi](https://forum.cmascenter.org/u/farzad-faghihi)\
**Post date:** [November 13, 2021, 3:08am UTC](https://forum.cmascenter.org/t/error-installation/2747/18 "2021-11-13T03:08:35Z")

</div>

You are right.  
Based on this code I have found in write\_outputs.pl it should be produced but I do not know why it is not produced.

> if ( $runout eq “” || $runout eq “VOC” && $runtype ne “HAPLIST” )  
> {  
> $outvoc = “…/outputs/SPECIATE5\_VP.IVOCP6-SVOCN1.$runDate.txt”;  
> open(VOCFILE, “\>$outvoc”) or die “Unable to open SPECIATE VP output file for writing: $outvoc\n”;
